Schema reference
Top-level config, collections, blocks, and where to find the rest.
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.
Field types
Every field type (text, paragraph, richtext, number, boolean, date, color, range, multichoice, link, image, file, select, group, array) with the YAML it produces.
Validation
Built-in validators with custom messages, plus the customValidators escape hatch.
Conditional rendering
visibleIf, path syntax, operators, composite conditions, whenHidden.
Computed fields
Auto-derive a field from another. Slug from title is the canonical case.
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| Key | Type | Effect |
|---|---|---|
schemaVersion | integer | Required. Bumped when a breaking schema-language change lands. |
publicDir | string | Where the deployed site serves static files from (public, static). |
mediaDir | string | Pre-storages upload root. New sites should use storages: instead. |
collections | array (dir-based) | Use .norcube/cms/collections/*.yml files; the array form is legacy. |
storages | object | See Media library. |
defaultStorage | string | Storage name used when a field omits storage:. |
extraKeysPolicy | show | hide | strip | What to do with YAML keys not in the schema. strip purges on save. |
inputsFromGlob | array of paths | Extra 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: [...]| Key | Required | Effect |
|---|---|---|
label | ✓ | Human-facing collection name (shown in nav). |
path | ✓ | Where content files live, repo-relative. |
match | ✓ | Glob of files in path that are part of the collection. |
fields | ✓ | Ordered 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: HeadingOther 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