backend:
  name: github
  repo: jmBohen/pamietnik
  branch: main
  auth_methods: [token]

site_url: https://pamietnik.pages.dev
display_url: https://pamietnik.pages.dev
logo_url: /favicon.svg

media_folder: public/media
public_folder: /media

# Bez transformacji — bywały przypadki, że pipeline „połykał” upload bez błędu.
# Limit świadomie niski: GitHub GraphQL kiepsko znosi duże base64 (filmiki).
media_libraries:
  default:
    config:
      max_file_size: 15000000
      slugify_filename: true

slug:
  encoding: ascii
  clean_accents: true

collections:
  - name: wyprawy
    label: Wyprawy
    label_singular: Wyprawa
    folder: src/content/wyprawy
    create: true
    slug: '{{numer}}'
    extension: md
    format: frontmatter
    summary: 'Wyprawa {{numer}} — {{tytul}}'
    media_folder: public/media/wyprawy/{{numer}}
    public_folder: /media/wyprawy/{{numer}}
    sortable_fields:
      fields: [numer, data_od, tytul]
      default:
        field: numer
        direction: ascending
    fields:
      - { name: numer, label: Numer, widget: number, value_type: int, min: 0 }
      - { name: tytul, label: Tytuł, widget: string }
      - { name: data_od, label: Data od, widget: datetime, time_format: false, date_format: YYYY-MM-DD }
      - { name: data_do, label: Data do, widget: datetime, time_format: false, date_format: YYYY-MM-DD }
      - { name: region, label: Region, widget: string }
      - name: aktywnosci
        label: Aktywności
        widget: select
        multiple: true
        options:
          - { label: Piesze, value: piesze }
          - { label: Skitouring, value: skitouring }
          - { label: Wspinaczka, value: wspinaczka }
          - { label: Inne, value: inne }
        required: false
      - { name: wstep, label: Wstęp, widget: text, required: false }
      - { name: wierzcholki, label: Zdobyte szczyty, widget: list, required: false }
      - { name: przelecze, label: Ważne przełęcze, widget: list, required: false }
      - { name: body, label: Notatki (opcjonalnie), widget: markdown, required: false }

  - name: wyjscia
    label: Wyjścia
    label_singular: Wyjście
    folder: src/content/wyjscia
    create: true
    slug: '{{wyprawa}}-{{numer}}'
    extension: md
    format: frontmatter
    summary: 'W{{wyprawa}} · Wyjście {{numer}} — {{tytul}}'
    sortable_fields:
      fields: [wyprawa, numer, data, tytul]
      default:
        field: wyprawa
        direction: ascending
    media_folder: public/media/wyprawy/{{wyprawa}}
    public_folder: /media/wyprawy/{{wyprawa}}
    fields:
      - { name: wyprawa, label: Numer wyprawy, widget: number, value_type: int, min: 0 }
      - { name: numer, label: Numer wyjścia, widget: number, value_type: int, min: 0 }
      - { name: tytul, label: Tytuł, widget: string }
      - { name: data, label: Data, widget: datetime, time_format: false, date_format: YYYY-MM-DD }
      - name: body
        label: Zapiska
        widget: markdown
        editor_components: [image, video]
        hint: >-
          Zdjęcie: przycisk obrazka. Filmik: przycisk „Filmik” (nie Select Image —
          tam są tylko fotki). Albo ręcznie: ![opis](/media/wyprawy/{{wyprawa}}/plik.mp4)
        media_folder: public/media/wyprawy/{{wyprawa}}
        public_folder: /media/wyprawy/{{wyprawa}}
      - name: mapa
        label: Mapa trasy
        widget: text
        required: false
        hint: >-
          Wklej cały kod embed z mapa-turystyczna.pl (iframe).
          Przykład: skopiuj „Umieść na stronie” / widget trasy.