Schema reference

Schema reference

Top-level config, collections, blocks, and where to find the rest.

Not verified yet

The CMS reads its schema from .norcube/cms/config.yml plus the per-block files under .norcube/cms/collections/ and .norcube/cms/blocks/. This section is the reference for every knob you can set.

For the bigger picture — how schemas, collections, and storages fit together — see Getting started.

Top-level (config.yml)

# .norcube/cms/config.yml
schemaVersion: 1 # required; the loader rejects unknown versions
publicDir: public # leading-slash asset resolver root
mediaDir: public # legacy whole-repo upload root (storages preferred)
collections: [] # see collections directory below
storages: {} # see Storages
defaultStorage: uploads # fallback for fields with no `storage:`
extraKeysPolicy: show # show | hide | strip
inputsFromGlob: [] # extra paths to load schema snippets from
KeyTypeEffect
schemaVersionintegerRequired. Bumped when a breaking schema-language change lands.
publicDirstringWhere the deployed site serves static files from (public, static).
mediaDirstringPre-storages upload root. New sites should use storages: instead.
collectionsarray (dir-based)Use .norcube/cms/collections/*.yml files; the array form is legacy.
storagesobjectSee Media library.
defaultStoragestringStorage name used when a field omits storage:.
extraKeysPolicyshow | hide | stripWhat to do with YAML keys not in the schema. strip purges on save.
inputsFromGlobarray of pathsExtra directories to load schema snippets from (in addition to .norcube/cms/inputs/).

Collections

One YAML file per collection under .norcube/cms/collections/<name>.yml:

label: Pages
path: src/content/pages
match: '**/*.md'
fields: [...]
KeyRequiredEffect
labelHuman-facing collection name (shown in nav).
pathWhere content files live, repo-relative.
matchGlob of files in path that are part of the collection.
fieldsOrdered list of frontmatter fields. See Field types.

Blocks

One YAML file per nestable block under .norcube/cms/blocks/<name>.yml:

label: Hero compact
fields:
  - key: heading
    type: text
    label: Heading

Other parts of the schema reference these via $ref: <name> (typically inside an array field's items:). The on-disk basename is what $ref: matches against — blocks/hero-compact.yml is referenced as $ref: hero-compact.

Storages

See the dedicated Media library page for the full storage reference. Minimal recap:

storages:
  uploads:
    type: repo
    path: public/uploads
    publicUrl: /uploads
    naming: slug+hash
    dedup: hash

defaultStorage: uploads

On this page