# Decap CMS — GitHub-backed editorial admin
# Replace repo with your GitHub owner/name before deploying.
backend:
  name: github
  repo: your-username/laneaux
  branch: main
  # Optional: custom OAuth gateway URL if not using Netlify's proxy
  # base_url: https://your-oauth-gateway.example.com

# Enable local editing with: npx decap-server
local_backend: true

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

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

collections:
  - name: blog
    label: Blog Posts
    label_singular: Blog Post
    folder: src/content/blog
    create: true
    delete: true
    slug: "{{slug}}"
    extension: md
    format: frontmatter
    sortable_fields: ["date", "title", "category", "author", "draft"]
    view_filters:
      - label: Drafts
        field: draft
        pattern: true
      - label: Published
        field: draft
        pattern: false
      - label: Travel
        field: category
        pattern: travel
      - label: Timber Framing
        field: category
        pattern: timber-framing
      - label: Projects
        field: category
        pattern: projects
      - label: House
        field: category
        pattern: house
      - label: Garden
        field: category
        pattern: garden
      - label: Sara
        field: author
        pattern: sara
      - label: Joe
        field: author
        pattern: joe
    fields:
      - { label: Title, name: title, widget: string }
      - { label: Description, name: description, widget: text, hint: "Short summary for cards and SEO (1–2 sentences)." }
      - { label: Publish Date, name: date, widget: datetime, date_format: YYYY-MM-DD, time_format: false }
      - label: Author
        name: author
        widget: select
        options:
          - { label: Sara, value: sara }
          - { label: Joe, value: joe }
        hint: "Who wrote this post."
      - label: Category
        name: category
        widget: select
        options:
          - { label: Travel, value: travel }
          - { label: Timber Framing, value: timber-framing }
          - { label: Projects, value: projects }
          - { label: House, value: house }
          - { label: Garden, value: garden }
        hint: "Exactly one primary category per post."
      - label: Tags
        name: tags
        widget: list
        required: false
        allow_add: true
        hint: "Optional freeform tags (separate from category)."
        field: { label: Tag, name: tag, widget: string }
      - label: Featured Image
        name: image
        widget: image
        choose_url: true
        media_folder: /public/images/uploads
        public_folder: /images/uploads
      - { label: Image Alt Text, name: imageAlt, widget: string, required: false, hint: "Describe the image for accessibility." }
      - { label: Draft, name: draft, widget: boolean, default: false, required: false }
      - { label: Body, name: body, widget: markdown }
