Define editable collections and files in your repository.

Overview

content defines what editors can edit.

Each entry is either:

  • a collection for many files with the same schema
  • a file for one file with its own schema
  • a group for organizing files and collections in the sidebar

group is navigation-only. It can contain nested group, collection, and file entries, but it does not create its own editor route.

Keys

Key Description
name * Unique internal name (e.g. "posts").
label UI label (e.g. "Blog posts").
type * Values: collection, file, group.
path * Folder for collections or file path for single files (e.g. "content/posts", "data/site.yml"). Not used by group.
fields Field definitions shown in the editor. Fields support options like required, hidden, and readonly. Read more about: fields, editors
filename Collection filename template or object config. Read more about filename
exclude Files to ignore in a collection (e.g. ["README.md"]).
format File format. Values include yaml-frontmatter, json-frontmatter, toml-frontmatter, yaml, json, toml, datagrid, code, raw. Read more about editors
delimiters Custom frontmatter delimiters (e.g. "+++", ["<!--", "-->"]).
subfolders Enables or disables nested folders in collections.
list For type: file, store the whole file as a top-level array.
view Collection list settings for fields, sorting, search, and tree mode. Read more about view
commit Per-entry commit settings. See settings.
items Child entries inside a group.

*: Required

Examples

Collection

content:
  - name: posts
    label: Posts
    type: collection
    path: content/posts
    fields:
      - name: title
        type: string
      - name: body
        type: rich-text

Single file

content:
  - name: site
    label: Site settings
    type: file
    path: data/site.yml
    fields:
      - name: title
        type: string
      - name: description
        type: text

Root arrays in single files

If a file stores a top-level array, set list: true.

content:
  - name: authors
    label: Authors
    type: file
    path: data/authors.json
    format: json
    list: true
    fields:
      - name: name
        type: string
      - name: email
        type: string
      - name: avatar
        type: image

Nested groups

Use type: group to organize large content menus without changing how content is stored internally.

content:
  - name: docs
    label: Docs
    type: group
    items:
      - name: pages
        label: Pages
        type: collection
        path: content/pages
        fields:
          - name: title
            type: string

      - name: references
        label: References
        type: group
        items:
          - name: publications
            label: Publications
            type: file
            path: data/publications.json
            format: json
            list: true
            fields:
              - name: title
                type: string