# Sveltia CMS — Unique Wood Paraguay (https://www.unique-wood.com)
# Edits commit straight to the `main` branch of malte/unique_wood on
# git.unique-landuse.de. After saving, the site must be rebuilt/redeployed
# (npm run build → deploy.sh) for changes to appear live.

backend:
  name: gitea
  repo: malte/unique_wood
  branch: main
  base_url: https://git.unique-landuse.de
  api_root: https://git.unique-landuse.de/api/v1
  app_id: 703bccdf-122c-4dc6-8bba-c45776c551f5

# Required by the config schema. Not actively used — images on this site are
# referenced by path (e.g. /images/uw/products/veneer), edited as plain text.
media_folder: "public/images/uw/uploads"
public_folder: "/images/uw/uploads"

site_url: https://www.unique-wood.com
display_url: https://www.unique-wood.com

collections:
  - name: news
    label: "News"
    icon: article
    files:
      - name: news_list
        label: "News articles"
        file: "src/data/news.json"
        description: >-
          Articles shown on /news. Newest first. Each has an English and a
          Spanish version. After saving, the site is rebuilt to go live.
        fields:
          - name: items
            label: "Articles"
            label_singular: "Article"
            widget: list
            summary: "{{fields.en.title}}  ·  {{fields.date}}"
            fields:
              - name: slug
                label: "URL slug"
                widget: string
                hint: "Lowercase-with-dashes. Becomes /news/<slug>. Don't change once published (breaks links)."
              - name: date
                label: "Date"
                widget: datetime
                date_format: "YYYY-MM-DD"
                time_format: false
                picker_utc: true
              - name: pdf
                label: "PDF note (optional)"
                widget: string
                required: false
                hint: "e.g. '2.2 MB' to show a 'request document' button. Leave blank for none."
              - name: en
                label: "English"
                widget: object
                fields:
                  - { name: title, label: "Title", widget: string }
                  - name: body
                    label: "Body paragraphs"
                    widget: list
                    field: { name: paragraph, label: "Paragraph", widget: text }
              - name: es
                label: "Spanish / Español"
                widget: object
                fields:
                  - { name: title, label: "Título", widget: string }
                  - name: body
                    label: "Párrafos"
                    widget: list
                    field: { name: paragraph, label: "Párrafo", widget: text }

  - name: products
    label: "Products"
    icon: inventory_2
    files:
      - name: products_list
        label: "Product catalogue"
        file: "src/data/products.json"
        description: >-
          The wood product catalogue (/products). Each product is bilingual.
          Spec blocks come in three kinds — pick the matching one when adding.
        fields:
          - name: items
            label: "Products"
            label_singular: "Product"
            widget: list
            summary: "{{fields.name.en}}"
            fields:
              - name: slug
                label: "URL slug"
                widget: string
                hint: "Lowercase-with-dashes. Becomes /products/<slug>."
              - name: image
                label: "Main image path"
                widget: string
                hint: "Path without extension, e.g. /images/uw/products/veneer"
              - name: name
                label: "Name"
                widget: object
                fields:
                  - { name: en, label: "English", widget: string }
                  - { name: es, label: "Spanish", widget: string }
              - name: tagline
                label: "Tagline"
                widget: object
                required: false
                fields:
                  - { name: en, label: "English", widget: string, required: false }
                  - { name: es, label: "Spanish", widget: string, required: false }
              - name: gallery
                label: "Extra image paths (optional)"
                widget: list
                required: false
                field: { name: path, label: "Image path", widget: string }
              - name: imageCaptions
                label: "Image captions (optional)"
                widget: list
                required: false
                fields:
                  - { name: en, label: "English", widget: string }
                  - { name: es, label: "Spanish", widget: string }
              - name: blocks
                label: "Content blocks"
                label_singular: "Block"
                widget: list
                typeKey: kind
                summary: "{{fields.kind}}"
                types:
                  - name: specs
                    label: "Spec list (label → value rows)"
                    fields:
                      - name: title
                        label: "Heading"
                        widget: object
                        fields:
                          - { name: en, label: "English", widget: string }
                          - { name: es, label: "Spanish", widget: string }
                      - name: rows
                        label: "Rows"
                        widget: list
                        summary: "{{fields.k.en}}: {{fields.v.en}}"
                        fields:
                          - name: k
                            label: "Label"
                            widget: object
                            fields:
                              - { name: en, label: "English", widget: string }
                              - { name: es, label: "Spanish", widget: string }
                          - name: v
                            label: "Value"
                            widget: object
                            fields:
                              - { name: en, label: "English", widget: string }
                              - { name: es, label: "Spanish", widget: string }
                  - name: table
                    label: "Data table (header row + rows of cells)"
                    fields:
                      - name: head
                        label: "Column headers"
                        widget: list
                        summary: "{{fields.en}}"
                        fields:
                          - { name: en, label: "English", widget: string }
                          - { name: es, label: "Spanish", widget: string }
                      - name: body
                        label: "Rows"
                        widget: list
                        field:
                          name: cells
                          label: "Row cells"
                          widget: list
                          field: { name: cell, label: "Cell", widget: string }
                  - name: text
                    label: "Text block (heading + paragraph)"
                    fields:
                      - name: title
                        label: "Heading"
                        widget: object
                        fields:
                          - { name: en, label: "English", widget: string }
                          - { name: es, label: "Spanish", widget: string }
                      - name: body
                        label: "Text"
                        widget: object
                        fields:
                          - { name: en, label: "English", widget: text }
                          - { name: es, label: "Spanish", widget: text }
  - name: team
    label: "Team"
    icon: groups
    # Foto-Uploads dieser Collection landen im Team-Ordner und werden als
    # /images/uw/team/<datei> gespeichert (überschreibt den globalen uploads-Ordner).
    media_folder: "/public/images/uw/team"
    public_folder: "/images/uw/team"
    files:
      - name: team_list
        label: "Mitarbeiterprofile"
        file: "src/data/team.json"
        description: >-
          Personenverzeichnis auf /about. In Gruppen organisiert; jede Person
          hat Name, Foto und zweisprachige Rolle. Nach dem Speichern muss die
          Seite neu gebaut/deployt werden.
        fields:
          - name: groups
            label: "Gruppen"
            label_singular: "Gruppe"
            widget: list
            summary: "{{fields.name.en}}"
            fields:
              - name: name
                label: "Gruppenname"
                widget: object
                fields:
                  - { name: en, label: "English", widget: string }
                  - { name: es, label: "Español", widget: string }
              - name: members
                label: "Personen"
                label_singular: "Person"
                widget: list
                summary: "{{fields.name}} — {{fields.role.en}}"
                fields:
                  - { name: name, label: "Name", widget: string }
                  - name: photo
                    label: "Foto"
                    widget: image
                    hint: "Quadratisches Porträt. Wird nach /images/uw/team/ hochgeladen."
                  - name: role
                    label: "Rolle"
                    widget: object
                    fields:
                      - { name: en, label: "English", widget: string }
                      - { name: es, label: "Español", widget: string }
