# Decap CMS configuration — the editing UI at /admin/
#
# BACKEND
#   git-gateway works out of the box on Netlify (enable Identity + Git Gateway
#   in your Netlify site settings, then invite editors by email). To edit
#   locally without deploying, run `npm run cms` in a second terminal and set
#   `local_backend: true` below — visit http://localhost:4321/admin/.
#
# If you host on GitHub Pages / elsewhere, switch backend to `github` and set
#   repo: your-org/your-repo
backend:
  name: git-gateway
  branch: main

# Enable this to test the editor locally with `npm run cms` (decap-server).
local_backend: true

# Uploaded images land in public/images and are referenced as /images/<file>.
media_folder: "public/images"
public_folder: "/images"

site_url: https://sonyashnyk-atx.com
display_url: https://sonyashnyk-atx.com
logo_url: /images/logo-mark.png

collections:
  - name: events
    label: Events
    label_singular: Event
    folder: src/content/events
    create: true
    slug: "{{slug}}"
    summary: "{{title}} — {{date}}"
    sortable_fields: [date, title]
    fields:
      - { name: title, label: Title, widget: string }
      - { name: date, label: Date & time, widget: datetime }
      - { name: endDate, label: End date (optional), widget: datetime, required: false }
      - { name: venue, label: Venue, widget: string }
      - { name: city, label: City, widget: string }
      - name: eventType
        label: Event type
        widget: select
        default: Concert
        options: [Festival, Concert, Cultural Event, Workshop, Private]
      - { name: ticketUrl, label: Ticket URL, widget: string, required: false }
      - { name: ticketLabel, label: Ticket button label, widget: string, default: "Get Tickets" }
      - { name: image, label: Image, widget: image, required: false }
      - { name: featured, label: Feature on homepage, widget: boolean, default: false }
      - { name: description, label: Short description, widget: text }
      - { name: body, label: Full details, widget: markdown, required: false }

  - name: dancers
    label: Dancers
    label_singular: Dancer
    folder: src/content/dancers
    create: true
    slug: "{{slug}}"
    summary: "{{name}} — {{role}}"
    sortable_fields: [order, name]
    fields:
      - { name: name, label: Name, widget: string }
      - { name: role, label: Role, widget: string }
      - { name: order, label: Sort order (lower = first), widget: number, default: 100, value_type: int }
      - { name: region, label: Region, widget: string, required: false }
      - { name: photo, label: Photo, widget: image, required: false }
      - { name: isInstructor, label: Instructor / staff, widget: boolean, default: false }
      - { name: body, label: Bio, widget: markdown, required: false }

  - name: media
    label: Media Gallery
    label_singular: Media item
    folder: src/content/media
    create: true
    slug: "{{slug}}"
    summary: "{{title}} ({{mediaType}})"
    sortable_fields: [order, title]
    fields:
      - { name: title, label: Title, widget: string }
      - name: mediaType
        label: Type
        widget: select
        options: [photo, video]
        default: photo
      - name: category
        label: Category
        widget: select
        default: Ensemble
        options: [Hopak, Poltava, Ensemble, Costumes]
      - { name: image, label: Photo (for photo items), widget: image, required: false }
      - { name: videoUrl, label: Video URL (YouTube/Vimeo, for video items), widget: string, required: false }
      - { name: order, label: Sort order, widget: number, default: 100, value_type: int }

  - name: dances
    label: Dances (History)
    label_singular: Dance
    folder: src/content/dances
    create: true
    slug: "{{slug}}"
    summary: "{{name}} — {{region}}"
    sortable_fields: [order, name]
    fields:
      - { name: name, label: Dance name, widget: string }
      - { name: region, label: Region, widget: string }
      - { name: order, label: Sort order, widget: number, default: 100, value_type: int }
      - { name: tagline, label: One-line tagline, widget: string }
      - { name: image, label: Image, widget: image, required: false }
      - { name: body, label: History / description, widget: markdown }
