Collections and files
content is a list. Each item is one of three types:
collection: a folder of files that share fields, such as blog posts.file: one file with its own fields, such as site settings.group: a sidebar section containing other items.
Collections
Add a collection to .pages.yml to edit files in a folder:
content:
- name: posts
label: Posts
type: collection
path: content/posts
fields:
- name: title
type: string
- name: body
type: rich-textEvery file in path with the matching extension is an entry. New entries are created there, named by the filename template.
If a GitHub folder times out while loading many entries, set large: true on that collection. Pages CMS reads the folder at one commit and loads its files in batches. The first load can take longer. Subsequent refreshes reuse cached text for unchanged files. Sorting, search and pagination work across the full collection.
On self-hosted Cloudflare Workers, a cold rebuild must fit within one request’s CPU and subrequest limits. Large folders can exceed the Workers Free limits. The number of files that fit depends on file sizes and parsing cost. Use Workers Paid or the Node runtime if cold loads exceed those limits. Cloudflare Workers limits
Files
Add a file to .pages.yml to edit it individually:
content:
- name: settings
label: Site settings
type: file
path: data/settings.yml
fields:
- name: title
type: string
- name: description
type: textpath is the full path to the file, including its name. If the file is a top-level list, such as an array of authors, set list: true:
- name: authors
type: file
path: data/authors.json
list: true
fields:
- name: name
type: string
- name: avatar
type: imageWithout fields, a file opens in a source editor. See File formats.
Groups
Groups organize the sidebar. They don't change where content is stored, and they can be nested.
content:
- name: blog
label: Blog
type: group
items:
- name: posts
type: collection
path: content/posts
fields: [{ name: title, type: string }]
- name: authors
type: collection
path: content/authors
fields: [{ name: name, type: string }]Keys
Operations
By default editors can create, rename and delete collection entries, and create or delete a single file. Set an operation to false to turn it off:
- name: legal
type: collection
path: content/legal
operations:
create: false
delete: falseSet operations: false to disable every available operation. Editors can still edit existing content.
Operations apply to everyone, managers included. They limit what the interface offers; they don't grant access.
Sidebar icons
icon takes a name from the Hugeicons free set in PascalCase, such as News01 or News01Icon. Unknown names fall back to the default icon. Media libraries also accept an icon.