site_url: https://monnaie-libre.fr
# site_url: http://localhost:3000
# site_url: https://monnaie-libre-fr.duniter.io/
logo_url: /admin/favicon-admin.svg

backend:
## Local backend configuration
#   name: git-gateway
#   branch: master
# local_backend: true
## gitlab backend configuration https://www.netlifycms.org/docs/gitlab-backend/
  name: gitlab
  repo: "websites/monnaie-libre-fr"
  auth_type: pkce
  app_id: 6e22ae7895c421f05b6f5443f29db4008e62889efe9166e04d859677e965a173 # Application ID from https://git.duniter.org/groups/websites/-/settings/applications
  api_root: https://git.duniter.org/api/v4
  base_url: https://git.duniter.org
  auth_endpoint: oauth/authorize

publish_mode: editorial_workflow

media_folder: static/uploads
public_folder: /uploads

locale: 'fr'

# Docs: https://www.netlifycms.org/docs/configuration-options/#collections
collections:
  - name: pages
    label: Pages
    label_singular: Page
    description: Pages principales du site.
    format: frontmatter
    folder: content/pages
    create: true
    preview_path: "{{slug}}"
    fields:
      - { label: Titre, name: title, widget: string }
      - { label: Résumé, name: description, widget: string, hint: Le résumé est affiché dans les résultats de recherche. }
      - { label: Contenu, name: body, widget: markdown }

  - name: blog
    label: Blog
    format: frontmatter
    folder: content/blog
    create: true
    preview_path: "blog/{{slug}}"
    fields:
      - { label: Titre, name: title, widget: string }
      - { label: Résumé, name: description, widget: string, hint: Le résumé est affiché dans les listes d'articles de blog. }
      - { label: Date de publication, name: createdAt, widget: datetime, hint: Permet de classer les articles de blog. Le plus récent en premier. }
      - { label: Catégorie, name: categories, required: false, widget: relation, collection: settings, file: categories, search_fields: ["blog.*.title"], value_field: blog.*.title, multiple: true, options_length: 4 }
      - { label: Contenu, name: body, widget: markdown }

  - name: faq
    label: FAQ
    description: Foire aux questions
    format: frontmatter
    folder: content/faq
    create: true
    preview_path: "faq/{{slug}}"
    fields:
      - { label: Question, name: title, widget: string }
      - { label: Résumé, name: description, widget: string, hint: Le résumé est affiché dans la liste des questions. }
      - { label: Réponse, name: body, widget: markdown }

  - name: lexique
    label: Lexique
    label_singular: Élément du lexique
    description: Définition des termes utilisés pour la monnaie libre
    format: frontmatter
    folder: content/lexique
    create: true
    preview_path: "lexique/{{slug}}"
    fields:
      - { label: Titre, name: title, widget: string }
      - { label: Résumé, name: description, widget: string, hint: Le résumé est affiché dans le lexique et dans les bulles d'info. }
      - { label: Synonymes, name: synonyms, widget: list, hint: Synonymes du titre. Séparé par des virgules. Insensible à la casse. }
      - { label: Définition, name: body, widget: markdown }

  - name: ressources
    label: Ressources
    label_singular: Ressource
    description: Sites web, vidéos, tutoriels, applications...
    format: json
    folder: content/ressources
    create: true
    fields:
      - { label: Lien, name: url }
      - { label: Titre, name: title }
      - { label: Description, name: description, required: false }
      - label: Image
        name: image
        required: false
        widget: image
        media_library:
          config:
            multiple: false
      - label: Catégorie
        name: categories
        required: false
        widget: relation
        collection: settings
        file: categories
        search_fields: ["ressources.*.title"]
        value_field: ressources.*.title
        multiple: true
      - { label: Portefeuille Ğ1, name: wallet, required: false }
      - name: related
        label: Lien complémentaire
        widget: list
        fields:
          - { name: url }
          - { label: Icône, name: icon, required: false }

  - name: settings
    label: Paramètres
    description: Paramètres généraux du site
    editor:
      preview: false
    files:
      - name: categories
        label: Categories
        file: static/settings/categories.json
        fields:
          - name: ressources
            label: Categories des ressources
            widget: list
            fields:
              - { label: Nom, name: title, widget: string }
          - name: blog
            label: Catégories du blog
            widget: list
            fields:
              - { label: Nom, name: title, widget: string }
      - name: menus
        label: Menus
        file: static/settings/menus.json
        fields:
          - name: menu_header
            label: Menu en entête
            widget: list
            fields:
              - { label: Titre, name: title }
              - { name: url }
              - { label: Icône, name: icon, required: false }
          - label: Menus du footer
            name: menu_footer
            widget: list
            types:
              - label: Colonne
                name: column
                widget: object
                summary: "{{fields.title}}"
                fields:
                  - { label: Titre, name: title }
                  - label: Menus
                    name: menus
                    widget: list
                    fields:
                      - { label: Titre, name: title }
                      - { name: url }
                      - { label: Icône, name: icon, required: false }
              - label: Ressources
                name: ressources
                widget: object
                summary: "{{fields.title}}"
                fields:
                  - { label: Titre, name: title }
      - name: general
        label: Général
        file: static/settings/globals.json
        fields:
          - { label: Url du site, name: site_url, widget: string }
          - { label: Titre du site, name: site_title, widget: string }
          - { label: Logo du site, name: site_logo, widget: image, allow_multiple: false }
          - { label: Meta description du site, name: site_description, widget: string }
          - { label: Url du forum, name: forum_url, widget: string }