Groups fields into a nested object.

Add this field under fields in .pages.yml:

- name: author
  type: object
  fields:
    - name: name
      type: string
    - name: email
      type: string

A saved value in YAML or Markdown front matter might look like:

author:
  name: Sam Lee
  email: sam@example.com

With list: true, it becomes a list of objects:

- name: links
  type: object
  list: true
  fields:
    - name: label
      type: string
    - name: url
      type: string
      pattern:
        regex: '^https://'
        message: A full address, starting https://

A saved value in YAML or Markdown front matter might look like:

links:
  - label: GitHub
    url: https://github.com/SeymourpowellLtd

Long lists can collapse each item behind a summary; see lists.

Keys

Key Description
fields Required. The nested fields. A field with fields and no type is an object.

Required and read-only

  • Without required, an object can stay empty. Its child fields' rules apply only once something in it has a value.
  • With required: true, its child fields' rules always apply. It doesn't make the child fields themselves required.
  • readonly: true makes every nested field read-only.

Reuse an object across content with components.