Documentation menu

Documentation › Configuration

Collections and fields

Correcting or adding collections, fields and page-section types in galley.config.json, and the 17 field types.

This page is for developers. Every collection detection finds can be adjusted by its id, every field by its key, every page-section type by its type — and collections detection missed can be added. The full key list with types and defaults is in the config reference.

Link to this section: Collections

A collection is either entries — a folder with one file per page, post or person — or data — one file of settings, navigation or records.

KeyMeaning
idRequired. Matches a detected collection, or adds a new one.
label, singularThe plural and singular names the editor sees: Journal, post.
descriptionA sentence shown with the collection and given to the assistant.
kindentries or data. For a new collection, inferred from path: a .json, .yaml, .yml or .toml file is data.
pathFolder (entries) or file (data), relative to the site root. Required for a new collection.
patternEntries: a glob inside path, such as **/*.md or *.{md,mdx}.
formatmarkdown, mdx, json, yaml or toml (TOML is read-only).
bodyWhether entries have a markdown body below the front matter.
urlThe public URL pattern, with {slug}: "/blog/{slug}/". null means the entries have no page of their own.
titleField, dateField, imageField, draftFieldWhich field the list view uses for the title, date, thumbnail and draft badge. Detected from common names (title, name, date, pubDate, image, cover, draft, …).
createWhether new entries may be created from the app.
hiddenLeave it out of the navigation (its files stay editable).
fieldsField overrides and additions — below.
json
{
  "collections": [
    { "id": "blog", "label": "Journal", "singular": "post", "url": "/journal/{slug}/", "dateField": "published" },
    { "id": "events", "path": "src/content/events", "pattern": "*.md", "url": "/events/{slug}/" },
    { "id": "settings", "path": "src/data/settings.yaml", "label": "Settings" },
    { "id": "drafts", "hidden": true }
  ]
}

slug is the entry's path inside the collection folder without its extension: src/content/blog/2026/launch.md has the slug 2026/launch. The pages collection maps index to /.

Link to this section: Fields

KeyMeaning
keyRequired. The key in the file.
labelThe label in the form. Defaults to the key in words (heroImage → Hero image).
typeOne of the 17 types below.
requiredWhether validation reports a missing value as an error.
descriptionHelp text under the field; also given to the assistant.
optionsselect: the allowed values. tags: suggestions.
defaultThe value a new entry starts with.
examplesSample values, shown as placeholders and given to the assistant.
hiddenHide it from the form. The value stays in the file untouched.
oflist: the shape of one item, itself a field (its key defaults to item).
fieldsobject: the nested fields.
discriminatorblocks: the key that names a section's type.
blocksblocks: the section types — below.
collectionreference: the collection the value points into.

A field config that names a key detection didn't see adds the field (type string unless you say otherwise).

json
{
  "collections": [
    {
      "id": "blog",
      "fields": [
        { "key": "category", "type": "select", "options": ["News", "Guides", "Studio"], "required": true },
        { "key": "author", "type": "reference", "collection": "team" },
        { "key": "description", "label": "Summary", "description": "Shown in search results. About 160 characters." },
        { "key": "seo", "type": "object", "fields": [{ "key": "image", "type": "image", "label": "Share image" }] },
        { "key": "legacyId", "hidden": true }
      ]
    }
  ]
}

Link to this section: Field types

TypeHoldsDetected from
stringone line of textany string
textseveral lines of plain textlong or multi-line strings
markdowntext with markdown allowedstrings with markdown syntax
numbera numbernumbers; z.number()
booleantrue or falsebooleans; z.boolean()
date2026-11-20ISO dates; z.date(), z.coerce.date()
datetime2026-11-20T09:30ISO date-times; .datetime()
imagea site image path (/images/x.webp) or URLimage extensions; image()
urla link: https://…, /a/page/, #anchor, mailto:link-shaped strings; .url()
colora hex colour, #1f6febhex values
selectone of optionsz.enum; strong evidence in the files
tagsa list of short stringslists of short strings; z.array(z.string())
lista list of ofother lists
objectnested fieldsobjects; z.object
blocksa list of objects, each of a type named by discriminator — page sectionslists of typed objects; discriminated unions
referencethe slug of an entry in collectionreference()
jsonanything else, edited as sourcevalues detection can't classify

Validation checks the types it can: required fields, numbers, booleans, dates, select values, unknown block types, images that don't exist under a media root, internal links that match no page. A missing required value is an error when the schema or the config says the field is required, and only a warning when inference alone does. Keys a file has that no field describes are warnings, never errors.

Link to this section: Page sections (blocks)

A blocks field carries one entry per section type. Adjust a detected type by its type, or declare one the files don't use yet:

json
{
  "collections": [
    {
      "id": "pages",
      "fields": [
        {
          "key": "sections",
          "blocks": [
            { "type": "hero", "label": "Opening", "description": "The first section of a page. One per page." },
            {
              "type": "quote",
              "label": "Quote",
              "fields": [
                { "key": "quote", "type": "text", "required": true },
                { "key": "name", "type": "string" }
              ],
              "example": { "type": "quote", "quote": "They measured the whole house.", "name": "A client" }
            }
          ]
        }
      ]
    }
  ]
}

example is the scaffold inserted by Add section for that type; detection keeps the most complete real instance from the files when there is one. count (how often the type appears) is filled in by detection; setting it has no effect on the files. A section whose type the site's components don't render is the site's business — on the starter, it shows a notice in development and nothing in a build.

Link to this section: Next