# Set up a site

This is for Seymourpowell developers. You need write access to the site's repository in the `SeymourpowellLtd` GitHub organisation.

## 1. Give SP CMS the repository

1. Ask an owner of the `SeymourpowellLtd` organisation to add the repository to the `seymourpowell-cms` GitHub App (organisation settings → GitHub Apps → `seymourpowell-cms` → Configure).
2. Sign in at [cms.seymourpowell.dev](https://cms.seymourpowell.dev) with **Team sign-in with GitHub**.
3. Open the repository from **Projects**.

## 2. Describe the content

Each folder or file editors should change gets an entry in `.pages.yml` at the root of the repository. 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. SP CMS then warns editors about anything the build would reject.

### With a coding agent

Open the site's repository in Claude Code, Cursor or Codex and paste this prompt:

```text
Read https://docs.seymourpowell.dev/reference/. Then inspect this repository, find where its content and media live, and write a .pages.yml at the root so editors can manage them in SP CMS. Mirror the content schema in src/content.config.ts: the same fields, required fields and limits. Use only the fields and options documented there and keep existing files where they are. When you are done, ask me to review and commit .pages.yml.
```

### By hand

Take one of the files editors will change, such as a news post:

```markdown title="src/content/news/hello-world.md"
---
title: Hello world
date: 2026-03-01
cover: /uploads/hello.jpg
link: https://example.com/story
---

Welcome to the news page.
```

Each front matter key becomes a field, and the text below becomes `body`. Describe the folder in `.pages.yml`, either in the repository or on the **Configuration** page in SP CMS:

```yaml title=".pages.yml"
content:
  - name: news
    label: News
    type: collection
    path: src/content/news
    fields:
      - name: title
        type: string
        required: true
      - name: date
        type: date
      - name: cover
        type: image
      - name: link
        type: string
        pattern:
          regex: '^https://'
          message: A full address, starting https://
      - name: body
        type: rich-text
```

Give every field that becomes a link a `pattern` like `link` above, and make the site's schema accept only `https` too (in Astro, `z.url({ protocol: /^https$/ })`), so a saved value can never put a `javascript:` link on the page.

## 3. Say where media goes

Find an existing image in the repository and how the content refers to it. For an Astro site, files in `public/uploads/a.jpg` are referred to as `/uploads/a.jpg`:

```yaml
media:
  input: public/uploads
  output: /uploads
```

See [media](/configuration/media/) for more than one media library, file types and size limits.

## 4. Check it and save an edit

Open the collection in SP CMS, such as **News** above. Check that an existing entry shows the right values, then change something and choose **Save**. The change is committed to the branch, and the site rebuilds as it does for any other push.

When it works, [invite the site's editors](/guides/collaborators/).

## Next

- [Fields](/configuration/fields/): every field type.
- [Collections and files](/configuration/content/): single files, groups and filenames.
- [Reference](/reference/): the whole of `.pages.yml` on one page.
