# Decap CMS configuration — the friendly /admin editor for your content.
# Posts and games are committed straight to GitHub; your host then auto-deploys.
# Activation steps live in DEPLOY.md → "Browser editing (Option B)".

backend:
  name: github
  repo: imjustcade/pixel-peasants-website
  branch: main

# Where images you upload through the CMS are stored / referenced.
media_folder: public/uploads
public_folder: /uploads

collections:
  - name: news
    label: News & Devlogs
    label_singular: Post
    folder: src/content/news
    create: true
    slug: '{{slug}}'
    extension: md
    format: frontmatter
    summary: '{{title}} — {{pubDate}}'
    fields:
      - { label: Title, name: title, widget: string }
      - { label: Description, name: description, widget: text }
      - {
          label: Publish date,
          name: pubDate,
          widget: datetime,
          format: 'YYYY-MM-DDTHH:mm:ssZ',
        }
      - {
          label: Updated date,
          name: updatedDate,
          widget: datetime,
          date_format: 'YYYY-MM-DD',
          time_format: false,
          format: 'YYYY-MM-DD',
          required: false,
        }
      - { label: Author, name: author, widget: string, default: 'The Pixel Peasants Team' }
      - { label: Tags, name: tags, widget: list, required: false }
      - { label: Draft (hide from the live site), name: draft, widget: boolean, default: true, required: false }
      - { label: Body, name: body, widget: markdown }

  - name: games
    label: Games
    label_singular: Game
    folder: src/content/games
    create: true
    slug: '{{slug}}'
    extension: md
    format: frontmatter
    summary: '{{title}} ({{status}})'
    fields:
      - { label: Title, name: title, widget: string }
      - {
          label: Status,
          name: status,
          widget: select,
          options: ['In Development', 'Coming Soon', 'Announced', 'Released'],
          default: 'In Development',
        }
      - { label: Genre, name: genre, widget: string }
      - { label: Blurb, name: blurb, widget: text }
      - { label: Tags, name: tags, widget: list, required: false }
      - { label: Featured on home page, name: featured, widget: boolean, default: false }
      - { label: Sort order (lower = first), name: order, widget: number, default: 0, value_type: int }
      - {
          label: Cover theme,
          name: coverTheme,
          widget: select,
          options: ['day', 'dusk', 'night', 'meadow', 'sunset'],
          default: 'day',
        }
      - {
          label: Cover image (optional — overrides the theme),
          name: coverImage,
          widget: image,
          required: false,
        }
      - {
          label: Links,
          name: links,
          widget: list,
          required: false,
          fields:
            [
              { label: Label, name: label, widget: string },
              { label: URL, name: href, widget: string },
            ],
        }
      - { label: Draft (hide from site), name: draft, widget: boolean, default: true, required: false }

  - name: settings
    label: Site & Pages
    files:
      - name: site
        label: Site Settings
        file: src/data/site.json
        fields:
          - { label: Studio name, name: name, widget: string }
          - { label: Legal name, name: legalName, widget: string }
          - { label: Tagline, name: tagline, widget: string }
          - { label: SEO description, name: description, widget: text }
          - { label: Contact email, name: email, widget: string }
          - { label: 'Header logo (blank = text wordmark)', name: logo, widget: image, required: false }
          - { label: 'Favicon (browser tab icon)', name: favicon, widget: image, required: false }
          - { label: 'Newsletter (Buttondown username)', name: newsletter, widget: string, required: false }
          - label: Social links
            name: social
            widget: list
            summary: '{{fields.label}}'
            fields:
              - { label: Label, name: label, widget: string }
              - { label: 'URL (blank = hidden)', name: href, widget: string, required: false }
      - name: home
        label: Home Page
        file: src/data/home.json
        fields:
          - label: Hero
            name: hero
            widget: object
            fields:
              - { label: 'Title — first word', name: titleLine1, widget: string }
              - { label: 'Title — accent word (gold)', name: titleAccent, widget: string }
              - { label: Description, name: description, widget: text }
              - label: Buttons
                name: buttons
                widget: list
                summary: '{{fields.label}}'
                fields:
                  - { label: Label, name: label, widget: string }
                  - { label: Link, name: href, widget: string }
                  - { label: Style, name: style, widget: select, options: [primary, ghost], default: primary }
          - label: Values / notes section
            name: values
            widget: object
            fields:
              - { label: Show this section, name: show, widget: boolean, default: true }
              - label: Notes
                name: items
                widget: list
                summary: '{{fields.title}}'
                fields:
                  - { label: Title, name: title, widget: string }
                  - { label: Text, name: body, widget: text }
          - label: Games section
            name: games
            widget: object
            fields:
              - { label: Show this section, name: show, widget: boolean, default: true }
              - { label: Eyebrow (small label), name: eyebrow, widget: string }
              - { label: Heading, name: heading, widget: string }
          - label: News section
            name: news
            widget: object
            fields:
              - { label: Show this section, name: show, widget: boolean, default: true }
              - { label: Eyebrow (small label), name: eyebrow, widget: string }
              - { label: Heading, name: heading, widget: string }
          - label: Closing call-to-action
            name: cta
            widget: object
            fields:
              - { label: Show this section, name: show, widget: boolean, default: true }
              - { label: Heading, name: heading, widget: string }
              - { label: Text, name: text, widget: text }
              - label: Buttons
                name: buttons
                widget: list
                summary: '{{fields.label}}'
                fields:
                  - { label: Label, name: label, widget: string }
                  - { label: Link, name: href, widget: string }
                  - { label: Style, name: style, widget: select, options: [primary, ghost], default: primary }
