# Decap CMS configuration for Aerapass
# Backend: use 'git-gateway' with Netlify Identity, or 'github' with repo: 'org/repo'
# For local editing without Git auth, uncomment below and run: npx decap-server
# local_backend: true
# backend:
#   name: git-gateway
#   branch: main
# For GitHub backend instead, use:
backend:
  name: github
  branch: main
  repo: "aerapass/aerapass.github.io"   # e.g. the repo that holds this site
  base_url: https://aerapass-decap-github-oauth.gabor-378.workers.dev
  auth_endpoint: /auth



site_url: https://aerapass.github.io
display_url: https://aerapass.github.io

# Paths are relative to where you run npx decap-server (repo root).
# If you run from aerapass-astro/, use: src/content/posts (no prefix).
# If you run from parent (e.g. landing-page-external/), use: aerapass-astro/src/content/posts
media_folder: "aerapass-astro/src/assets/img/blog"
public_folder: "../../assets/img/blog"

collections:
  - name: posts
    label: Blog posts
    label_singular: Blog post
    folder: "aerapass-astro/src/content/posts"
    create: true
    slug: "{{slug}}"
    extension: md
    format: frontmatter
    identifier_field: title
    summary: "{{title}}"
    sortable_fields: ["date", "title", "category"]
    view_filters:
      - label: General
        field: category
        pattern: General
      - label: Featured
        field: isFeatured
        pattern: true
    fields:
      - { label: Title, name: title, widget: string }
      - { label: Cover image, name: cover, widget: image, required: false }
      - { label: Publish date, name: date, widget: datetime }
      - { label: Category, name: category, widget: string }
      - { label: Featured, name: isFeatured, widget: boolean, default: false, required: false }
      - { label: Body, name: body, widget: markdown }
    preview_path: "blog/posts/{{filename}}"
    preview_path_date_field: date

  - name: faqs
    label: FAQs
    label_singular: FAQ
    folder: "aerapass-astro/src/content/faqs"
    create: true
    slug: "{{slug}}"
    extension: md
    format: frontmatter
    identifier_field: question
    summary: "{{question}}"
    sortable_fields: ["priority", "question", "language"]
    view_filters:
      - { label: English, field: language, pattern: en }
      - { label: German, field: language, pattern: de }
      - { label: Visible, field: visible, pattern: true }
    fields:
      - { label: Question, name: question, widget: string }
      - { label: Language, name: language, widget: select, options: ["en", "de"] }
      - { label: Visible, name: visible, widget: boolean, default: true }
      - { label: Priority, name: priority, widget: number, value_type: int, required: false }
      - { label: Page, name: page, widget: string, required: false }
      - { label: Body, name: body, widget: markdown }

  - name: reviews
    label: Reviews
    label_singular: Review
    folder: "aerapass-astro/src/content/reviews"
    create: true
    slug: "{{slug}}"
    extension: md
    format: frontmatter
    identifier_field: name
    summary: "{{name}} — {{company}}"
    fields:
      - { label: Name, name: name, widget: string }
      - { label: Position, name: position, widget: string }
      - { label: Company, name: company, widget: string }
      - { label: Body, name: body, widget: markdown }
