# Editor configuration (Sveltia CMS 0.248.0, vendored in /vendor).
# Posts are Markdown files in the site repo. Saving a draft opens a pull request
# on its own branch; Publish merges it, and the deploy workflow does the rest.
backend:
  name: github
  repo: breachready/br-marketing-website
  branch: main
  # GitHub Enterprise Cloud with data residency (ghe.com) has its API on an
  # api. subdomain. Phase 0 spike: confirm Sveltia accepts this form.
  api_root: https://api.breachready.ghe.com
  base_url: https://blog.breachready.com
  auth_endpoint: api/auth

publish_mode: editorial_workflow
site_url: https://breachready.com
display_url: https://breachready.com/blog
locale: en
media_folder: BreachReady Design System/assets/blog
public_folder: /assets/blog

collections:
  - name: posts
    label: Blog posts
    label_singular: Post
    folder: content/blog
    extension: md
    format: yaml-frontmatter
    create: true
    slug: "{{slug}}"
    summary: "{{title}} ({{date}})"
    sortable_fields: [date, title]
    fields:
      - { name: title, label: Title, widget: string, hint: "Sentence case. Becomes the page heading." }
      - { name: description, label: Search description, widget: text, hint: "One or two sentences, 120 to 160 characters. Shown in search results.", pattern: ["^.{50,200}$", "Between 50 and 200 characters."] }
      - { name: date, label: Publish date, widget: datetime, date_format: "YYYY-MM-DD", time_format: false }
      - { name: author, label: Author, widget: relation, collection: authors, search_fields: [name], value_field: "{{slug}}", display_fields: [name] }
      - name: category
        label: Category
        widget: select
        options:
          - { label: Board reporting, value: board-reporting }
          - { label: CIRM, value: cirm }
          - { label: CPS 234, value: cps-234 }
          - { label: Crisis communications, value: crisis-communications }
          - { label: Incident command, value: incident-command }
          - { label: Incident response plan, value: incident-response-plan }
          - { label: NIS2 and DORA, value: nis2-and-dora }
          - { label: Playbooks, value: playbooks }
          - { label: Privacy breaches, value: privacy-breaches }
          - { label: Ransomware, value: ransomware }
          - { label: SOCI Act, value: soci-act }
          - { label: Tabletop exercises, value: tabletop-exercises }
      - { name: tags, label: Tags, widget: list, required: false, field: { name: tag, label: Tag, widget: string } }
      - { name: hero, label: Hero image, widget: image, required: false }
      - { name: hero_alt, label: Hero image description, widget: string, required: false, hint: "Describe the image for people who cannot see it. Required if there is a hero image." }
      - { name: draft, label: Hold back from the site, widget: boolean, default: false, hint: "Leave off to publish when merged." }
      - { name: body, label: Body, widget: markdown }

  - name: authors
    label: Authors
    label_singular: Author
    folder: content/authors
    extension: json
    format: json
    create: true
    slug: "{{slug}}"
    fields:
      - { name: name, label: Name, widget: string }
      - { name: role, label: Role, widget: string }
      - { name: photo, label: Photo, widget: image, required: false }
      - { name: bio, label: Short bio, widget: text, required: false }
