# Backend: Git-based workflow via GitLab
backend:
  name: gitlab
  repo: weeklyOSM/weeklyHugo
  base_url: https://gitlab.fossgis.de
  api_root: https://gitlab.fossgis.de/api/v4
  branch: main
  publish_mode: editorial_workflow # to create merge requests
  auth_type: pkce
  app_id: 535fe52cbf9a0c0d921f0a1fdf63a4c4b4c1e158771c968c440df482e197c601

# Internationalization (i18n) Setup
i18n:
  structure: multiple_folders
  locales: ["en", "de", "es", "fr", "it", "pt", "br", "cz", "ru", "uk", "zh", "ja", "ko", "cn", "id", "nl", "pl", "sw", "tr"]
  default_locale: uk

# Media handling (Allowed for everyone)
media_folder: "static/wp-content/uploads"
public_folder: "/wp-content/uploads"

collections:

  - name: "posts"
    label: "Articles"
    # The {{locale}} placeholder automatically maps to the folders in i18n.locales
    folder: "content" # This is the default folder for the default locale (en)
    omit_default_locale_from_file_path: false # Omit the default locale from the file path
    path: "archives/{{filename}}"
    identifier_field: "title"
    extension: "md"
    format: "toml-frontmatter"
    i18n: true # Enables the side-by-side translation view
    create: false # Allow creating new articles
    delete: false # Set to false if users should only edit, not delete
    fields:
      # These 'name' values MUST match your Markdown header exactly
      - { label: "Title", name: "title", widget: "string", i18n: true }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          i18n: true,
        }
      - { label: "Draft Status", name: "draft", widget: "boolean", i18n: true }
      - {
          label: "Featured Image URL",
          name: "featureImage",
          widget: "string",
          i18n: true,
        }
      - {
          label: "Image Caption",
          name: "featureImageCap",
          widget: "text",
          i18n: true,
        }
      # The main text after the +++ block
      - { label: "Body", name: "body", widget: "markdown", i18n: true }
    sortable_fields: [ "date", "title" ]
    view_filters:
      - label: "Drafts"
        field: "draft"
        pattern: true
    default_sort:
      field: "date"
      direction: "Descending"

  - name: "pages"
    label: "Static Pages"
    folder: "content" # This is the default folder for the default locale (en)
    omit_default_locale_from_file_path: false # Omit the default locale from the file path
    path: "{{filename}}"
    identifier_field: "title"
    extension: "md"
    format: "toml-frontmatter"
    i18n: true # Enables the side-by-side translation view
    create: false # Allow creating new articles
    delete: false # Set to false if users should only edit, not delete
    fields:
      # These 'name' values MUST match your Markdown header exactly
      - { label: "Title", name: "title", widget: "string", i18n: true }
      # The main text after the +++ block
      - { label: "Body", name: "body", widget: "markdown", i18n: true }
