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: 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/SeymourpowellLtdLong lists can collapse each item behind a summary; see lists.
Keys
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: truemakes every nested field read-only.
Reuse an object across content with components.