Object
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: stringA saved value in YAML or Markdown front matter might look like:
author:
name: Sam Lee
email: sam@example.comWith list: true, it becomes a list of objects:
- name: links
type: object
list: true
fields:
- name: label
type: string
- name: url
type: stringA saved value in YAML or Markdown front matter might look like:
links:
- label: GitHub
url: https://github.com/acmeLong lists can collapse each item behind a summary; see Lists.
Keys
Required and read-only
required: trueon an object means it can't be empty. It doesn't make its child fields required.- Child fields'
requiredrules apply only once the object has some content, so an optional object can stay empty. readonly: truemakes every nested field read-only.
Reuse an object across content with components.