# Decap CMS — a lightweight, git-based admin for this Hugo site.
# It commits markdown straight to the Gitea repo; the public site stays static.
# Setup (Gitea OAuth app, deploy trigger): see /ADMIN.md.

backend:
  name: gitea
  repo: karim/kgva
  base_url: https://git.openbureau.ch
  branch: main
  app_id: ffca0fec-7927-4c79-bc98-a5d98e6e0379

# For editing locally without auth: run `npx decap-server` and uncomment:
# local_backend: true

media_folder: static/img
public_folder: /img

collections:
  # ── Projects ────────────────────────────────────────────────────────────
  - name: portfolio
    label: Portfolio
    label_singular: Project
    folder: content/portfolio
    create: true
    slug: "{{slug}}"
    summary: "{{title}}"
    editor:
      preview: false
    fields:
      - { label: Title, name: title, widget: string }
      - { label: Slug, name: slug, widget: string, hint: "url part, e.g. textilsteinwerk" }
      - { label: Date, name: date, widget: datetime }
      - { label: Draft, name: draft, widget: boolean, default: true, required: false }
      - { label: Thumbnail, name: thumbnail, widget: image, required: false }
      - { label: Studies path, name: studies, widget: string, required: false, hint: "/studies/hslu/ba/semester_05" }
      - { label: School, name: schools, widget: select, multiple: true, options: [hslu, ost], required: false }
      - { label: Degree, name: degrees, widget: select, multiple: true, options: [ba, ma], required: false }
      - { label: Semester, name: semesters, widget: list, required: false, hint: "e.g. semester_05" }
      - { label: Vimeo ID, name: vimeo, widget: string, required: false }
      - label: Images
        name: images
        widget: list
        required: false
        summary: "{{fields.name}}"
        fields:
          - { label: File, name: src, widget: image }
          - { label: Name (caption), name: name, widget: string }
      - { label: Description, name: body, widget: markdown, required: false }

  # ── Single pages ────────────────────────────────────────────────────────
  - name: pages
    label: Pages
    files:
      - label: Home (hero image)
        name: home
        file: content/_index.md
        fields:
          - { label: Title, name: title, widget: string }
          - { label: Description, name: description, widget: string }
          - { label: Hero image, name: heroImage, widget: image }
      - label: About
        name: about
        file: content/about.md
        fields:
          - { label: Title, name: title, widget: hidden, default: about }
          - { label: Description, name: description, widget: string }
          - { label: Layout, name: layout, widget: hidden, default: about }
          - { label: Body, name: body, widget: markdown }
      - label: Studio
        name: studio
        file: content/studio.md
        fields:
          - { label: Title, name: title, widget: hidden, default: studio }
          - { label: Description, name: description, widget: string }
          - { label: Body, name: body, widget: markdown }
      - label: Openbureau
        name: openbureau
        file: content/openbureau.md
        fields:
          - { label: Title, name: title, widget: hidden, default: openbureau }
          - { label: Description, name: description, widget: string }
          - { label: Body, name: body, widget: markdown }
      - label: CV
        name: cv
        file: content/cv.md
        fields:
          - { label: Title, name: title, widget: hidden, default: cv }
          - { label: Description, name: description, widget: string }
          - { label: Body, name: body, widget: markdown }
      - label: Colophon
        name: colophon
        file: content/colophon.md
        fields:
          - { label: Title, name: title, widget: hidden, default: colophon }
          - { label: Description, name: description, widget: string }
          - { label: Dotfile, name: dotfile, widget: hidden, default: true }
          - { label: Body, name: body, widget: markdown }

  # ── Legal notice sections ────────────────────────────────────────────────
  - name: legal
    label: Legal notice
    label_singular: Section
    folder: content/legal
    create: true
    slug: "{{slug}}"
    fields:
      # keep these hidden ones so the section stays a non-rendered fragment
      - { label: build, name: build, widget: hidden, default: { render: never, list: never } }
      - { label: Body, name: body, widget: markdown }
