# Sveltia CMS configuration

# This is where we configure the CMS repo and its collections and fields
# Sveltia CMS generally follows the Decap CMS configuration spec
# Decap CMS docs: https://decapcms.org/docs/intro/
# Sveltia CMS docs: https://github.com/sveltia/sveltia-cms#features
# Compute fields (read-only, template from other fields): https://sveltiacms.app/en/docs/fields/compute

# Enter your GitHub repo path and branch (defaults to master)
backend:
  name: github
  repo: gdauster/bh-env
  branch: main

# The folder used to store uploaded images
media_folder: "assets/img"
public_folder: "/gites/assets/img"

# The CMS collections and their fields
collections:
  - name: pages
    label: Pages
    label_singular: Page
    folder: src/pages/
    create: true
    slug: "{{slug}}"
    fields:
      - label: "Navigation"
        name: "eleventyNavigation"
        widget: "object"
        fields:
          - label: "Identifiant unique (slug)"
            name: key
            widget: string
            hint: "Identique au slug de la page (URL / nom de fichier). Mis à jour automatiquement ; utilisé pour la navigation et le champ parent."
          - label: "Page parent (navigation)"
            name: parent
            widget: relation
            collection: pages
            required: false
            multiple: false
            value_field: "{{eleventyNavigation.key}}"
            display_fields: ["title"]
            search_fields: ["title"]
      - { label: "layout", name: "layout", widget: "hidden", default: "page" }
      - { label: "tags", name: "tags", widget: "hidden", default: "pages" }
      - { label: "Ordre", name: "order", widget: "number", default: 999, required: false, hint: "Ordre d'affichage dans la navigation." }
      - { label: "Titre de la page", name: "title", widget: "string" }
      - { label: "Contenu de la page", name: "body", widget: "markdown", hint: "Contenu de la page. Texte, Markdown, et HTML sont supportés. Voir le cheat sheet Markdown: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" }
  - name: settings
    label: Configurations
    label_singular: Configuration
    icon: "settings"
    extension: "yml"
    format: "yml"
    files:
      - file: src/_data/_themes.yml
        label: Page d'accueil
        name: themes
        widget: object
        fields: 
          - name: available_themes
            label: Les blocs de la page d'accueil
            widget: list
            fields:
              - label: Titre
                name: title
                widget: string
              - label: Thème du bloc
                name: theme
                widget: "select"
                options: ["white", "blue", "gray"]
                hint: "Utilisé pour le fond et le texte du bloc."
              - label: Template
                name: ref
                widget: "select"
                options: ["hero", "missions", "testimonials", "faqs", "professions"]
                hint: "Template utilisé pour le bloc."
              - label: Visible
                name: visible
                widget: boolean
                default: true
                hint: "Visible sur la page d'accueil."
