.pages.yml sits at the root of the site's repository and describes what can be edited: which folders and files, which fields they have, and where uploads go. It describes files that already exist; it doesn't change how the site is built.

Edit it

Managers, people signed in with GitHub who have write access to the repository, can open Configuration in the project to edit .pages.yml with validation and autocompletion. You can also commit it like any other file. Each branch reads its own copy, so you can try a change on a branch first.

Unknown keys show a warning and are ignored. Errors, such as a wrong type or a missing required key, prevent saving. When a branch's configuration is broken, the Configuration item in the sidebar is marked Invalid.

How it fits with the site's schema

Mirror the site's own content schema (for an Astro site, src/content.config.ts): the same fields, the same required fields and the same limits. Content with fields can only be saved through its form, never as raw source, so rules such as required and pattern are checked on every save.

The site's build is still the final check. Its schema should reject anything a page can't use, so a mistake made outside SP CMS can't reach the live site. For any field that becomes a link, accept only https in both places: a pattern in .pages.yml and the site's schema.

A complete example

.pages.yml
media:
  input: public/uploads
  output: /uploads

content:
  - name: posts
    label: Blog posts
    type: collection
    path: src/content/posts
    view:
      fields: [title, date]
      default: { sort: date, order: desc }
    fields:
      - name: title
        type: string
        required: true
      - name: date
        type: date
      - name: cover
        type: image
      - name: seo
        component: seo
      - name: body
        type: rich-text

  - name: settings
    label: Site settings
    type: file
    path: src/data/settings.json
    fields:
      - name: title
        type: string
      - name: seo
        component: seo

components:
  seo:
    type: object
    fields:
      - name: description
        type: text
      - name: image
        type: image

actions:
  - name: deploy
    label: Deploy site
    workflow: deploy.yml

settings:
  content:
    merge: true

Top-level keys

Key Description
content Collections, single files and sidebar groups
media Where uploads are stored and the paths written into content
components Reusable field definitions
i18n Content languages
actions Buttons that run GitHub Actions workflows
settings Saving, commit messages, cache and configuration editing

Most sites only need content and media. Field types are listed under fields.

For coding agents

The configuration reference sums up the whole format on one page. Give it to a coding agent as context when it writes or changes a .pages.yml.