# Sveltia CMS — CRF Amazing Group
# Auth is handled by the Cloudflare Worker at backend.base_url.
# Username/password for Crystal and GitHub OAuth for Richard both go through that Worker.

backend:
  name: github
  repo: vistalandrichard-gif/crf-amazing-group
  branch: main
  base_url: https://crf-cms-auth.crfamazinggroup.workers.dev
  site_domain: rlcresidencesglobalcrf.com
  commit_messages:
    create: "content: create {{collection}} “{{slug}}”"
    update: "content: update {{collection}} “{{slug}}”"
    delete: "content: delete {{collection}} “{{slug}}”"
    uploadMedia: "content: upload {{path}}"
    deleteMedia: "content: delete {{path}}"

site_url: https://rlcresidencesglobalcrf.com
display_url: https://rlcresidencesglobalcrf.com
logo_url: https://rlcresidencesglobalcrf.com/brand/logo-header.png

media_folder: public/images/uploads
public_folder: /images/uploads

slug:
  encoding: ascii
  clean_accents: true
  sanitize_replacement: "-"

output:
  omit_empty_optional_fields: true

collections:
  - name: news
    label: News & Events
    label_singular: Article
    folder: src/content/news
    create: true
    slug: "{{slug}}"
    extension: md
    format: yaml-frontmatter
    editor:
      preview: true
    preview_path: news/{{slug}}
    summary: "{{title}}"
    sortable_fields: [title, date, published]
    view_filters:
      - { label: Published, field: published, pattern: true }
      - { label: Unpublished, field: published, pattern: false }
    fields:
      - { name: title, label: Title, widget: string }
      - { name: date, label: Date, widget: datetime, required: false, date_format: YYYY-MM-DD, time_format: false }
      - { name: cover, label: Cover image, widget: image, required: false }
      - { name: excerpt, label: Excerpt, widget: text, required: false }
      - { name: tags, label: Tags, widget: list, required: false }
      - { name: published, label: Published, widget: boolean, default: false, hint: "Unpublished articles stay off the live site. Use this for drafts and any post that still has a [to complete] note." }
      - { name: body, label: Body, widget: markdown }

  - name: team
    label: Team
    label_singular: Team member
    folder: src/content/team
    create: true
    slug: "{{slug}}"
    extension: md
    format: yaml-frontmatter
    preview_path: team
    summary: "{{name}} — {{role}}"
    sortable_fields: [order, name, published]
    fields:
      - { name: name, label: Name, widget: string }
      - { name: role, label: Role, widget: string, required: false, hint: "Use only a role she has actually stated." }
      - { name: location, label: Location or country, widget: string, required: false }
      - { name: photo, label: Photo, widget: image, required: false }
      - { name: order, label: Order, widget: number, default: 100, value_type: int, hint: "Lower numbers appear first." }
      - { name: published, label: Published, widget: boolean, default: false, hint: "Keep the profile unpublished until the name, role, and wording are confirmed." }
      - { name: body, label: Short bio, widget: markdown, required: false }

  - name: handover
    label: Handover Releases
    files:
      - name: releases
        label: Handover list
        file: src/data/handover.json
        preview_path: /
        fields:
          - { name: notes, label: Editor notes, widget: text, hint: "Internal reminder. Not shown on the public site." }
          - name: releases
            label: Releases
            widget: list
            summary: "{{project}}"
            fields:
              - { name: project, label: Project name, widget: string }
              - { name: slug, label: Project slug, widget: string, required: false, hint: "Optional. Must match a slug in projects.json if you want the project photo and link." }
              - { name: tower_or_unit, label: Tower or unit, widget: string, required: false }
              - { name: location, label: Location, widget: string, required: false }
              - { name: release_date, label: Release date, widget: string, required: false, hint: "Only if Crystal has confirmed a date. Leave blank otherwise." }
              - { name: photo, label: Photo, widget: image, required: false }
              - { name: caption, label: Caption, widget: string, required: false, hint: "Short grey line under the photo, e.g. a one-line description of the picture. Do not include a buyer’s name." }
              - { name: headline, label: Headline, widget: string, required: false, hint: "Optional. Defaults to “Handover day at {project}”." }
              - { name: body, label: Body, widget: text, required: false, hint: "Two short paragraphs, separated by a blank line. Do not invent facts or publish a buyer’s name." }
              - { name: note, label: Note, widget: string, required: false, hint: "Fallback short line if body is empty." }
              - { name: sample, label: Sample entry, widget: boolean, default: false, hint: "Turn this on only for layout placeholders. A Sample badge will show on the site." }
              - { name: published, label: Published, widget: boolean, default: false }
