# Decap CMS Configuration
# ========================
# Demo mode: uses local proxy backend (npx decap-server).
# No GitHub account needed — editors open /admin/ and edit immediately.
#
# To switch to production (GitHub-backed):
#   1. Comment out the "proxy" backend block below
#   2. Uncomment the "github" backend block
#   3. Set up a GitHub OAuth app or use an external OAuth proxy

# --- Local development backend (demo mode) ---
local_backend: true
backend:
  name: proxy
  proxy_url: http://localhost:8081/api/v1

# --- Production backend (uncomment when ready) ---
# backend:
#   name: github
#   repo: your-org/red-knot-astro
#   branch: main
#   # For Vercel (not Netlify), you need an external OAuth proxy:
#   # base_url: https://your-oauth-proxy.vercel.app

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

collections:
  # ──────────────────────────────────────────────
  # Blog Posts
  # ──────────────────────────────────────────────
  - name: blog
    label: Blog Posts
    label_singular: Blog Post
    folder: src/content/blog
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    extension: md
    format: yaml-frontmatter
    summary: "{{title}} — {{publishDate | date('YYYY-MM-DD')}}"
    sortable_fields: [publishDate, title]
    fields:
      - { label: Title, name: title, widget: string }
      - { label: Description, name: description, widget: text, required: false }
      - { label: Publish Date, name: publishDate, widget: datetime, date_format: YYYY-MM-DD, time_format: false }
      - { label: Author, name: author, widget: string, required: false }
      - { label: Hero Image, name: heroImage, widget: image, required: false }
      - { label: Tags, name: tags, widget: list, default: [] }
      - { label: Original URL, name: originalUrl, widget: string, hint: "Original www.w-z.com URL (for redirects)" }
      - { label: Draft, name: draft, widget: boolean, default: true }
      - { label: Body, name: body, widget: markdown }

  # ──────────────────────────────────────────────
  # Portfolio / Press Releases
  # ──────────────────────────────────────────────
  - name: portfolio
    label: Portfolio & Press
    label_singular: Portfolio Entry
    folder: src/content/portfolio
    create: true
    slug: "{{slug}}"
    extension: md
    format: yaml-frontmatter
    summary: "{{title}}"
    fields:
      - { label: Title, name: title, widget: string }
      - { label: Description, name: description, widget: text, required: false }
      - { label: Publish Date, name: publishDate, widget: datetime, date_format: YYYY-MM-DD, time_format: false, required: false }
      - { label: Hero Image, name: heroImage, widget: image, required: false }
      - { label: Original URL, name: originalUrl, widget: string, hint: "Original www.w-z.com URL" }
      - label: Categories
        name: categories
        widget: list
        default: []
        hint: "e.g. press-release, news, case-study"
      - { label: Draft, name: draft, widget: boolean, default: true }
      - { label: Body, name: body, widget: markdown }

  # ──────────────────────────────────────────────
  # Testimonials
  # ──────────────────────────────────────────────
  - name: testimonials
    label: Testimonials
    label_singular: Testimonial
    folder: src/content/testimonials
    create: true
    slug: "{{slug}}"
    extension: md
    format: yaml-frontmatter
    summary: "{{name}} — {{role}}"
    fields:
      - { label: Name, name: name, widget: string }
      - { label: Role, name: role, widget: string, required: false, hint: "e.g. VP of HR, Fortune 500 Retailer" }
      - { label: Organization, name: organization, widget: string, required: false }
      - { label: Original URL, name: originalUrl, widget: string, hint: "Original www.w-z.com URL" }
      - { label: Draft, name: draft, widget: boolean, default: true }
      - { label: Quote, name: body, widget: markdown }
