# Decap CMS — admin du blog saint-jean.co (servi sur /cms).
# Auth PROD : DecapBridge PKCE (login Google/Microsoft/mot de passe, sans compte GitHub).
# Test LOCAL : `npx decap-server` + http://localhost:3000/cms (local_backend ci-dessous).

# Use DecapBridge PKCE auth (required)
backend:
  name: git-gateway
  repo: ASJDot/saint-jean-co
  branch: main
  auth_type: pkce
  base_url: https://auth.decapbridge.com
  auth_endpoint: /sites/070b6fa4-2df8-40cc-8efa-c48399f58d9a/pkce
  auth_token_endpoint: /sites/070b6fa4-2df8-40cc-8efa-c48399f58d9a/token
  gateway_url: https://gateway.decapbridge.com

  # See who did what (optional)
  commit_messages:
    create: Create {{collection}} “{{slug}}” - {{author-name}} <{{author-login}}> via DecapBridge
    update: Update {{collection}} “{{slug}}” - {{author-name}} <{{author-login}}> via DecapBridge
    delete: Delete {{collection}} “{{slug}}” - {{author-name}} <{{author-login}}> via DecapBridge
    uploadMedia: Upload “{{path}}” - {{author-name}} <{{author-login}}> via DecapBridge
    deleteMedia: Delete “{{path}}” - {{author-name}} <{{author-login}}> via DecapBridge
    openAuthoring: Message {{message}} - {{author-name}} <{{author-login}}> via DecapBridge

# Enable PKCE fields (optional, recommended)
auth:
  email_claim: email
  first_name_claim: first_name
  last_name_claim: last_name
  avatar_url_claim: avatar_url

# Better Decap + Bridge logo (optional)
logo_url: https://decapbridge.com/decapcms-with-bridge.svg

# Add site links in Decap CMS (optional)
site_url: https://saint-jean.co

local_backend: true

media_folder: "public/blog/img"
public_folder: "/blog/img"

collections:
  - name: "blog"
    label: "Articles de blog"
    label_singular: "Article"
    folder: "content/blog"
    create: true
    slug: "{{slug}}"
    extension: "md"
    format: "frontmatter"
    summary: "{{title}} — {{date}}"
    fields:
      - { name: "title", label: "Titre", widget: "string" }
      - { name: "description", label: "Description (meta, 155-160 car.)", widget: "text" }
      - { name: "date", label: "Publié le", widget: "datetime", date_format: "YYYY-MM-DD", time_format: false }
      - { name: "updated", label: "Mis à jour le", widget: "datetime", date_format: "YYYY-MM-DD", time_format: false, required: false }
      - { name: "axis", label: "Axe éditorial", widget: "select", options: ["Souveraineté & AI Act", "IA & ERP", "Financement", "IA appliquée PME"] }
      - { name: "tags", label: "Tags", widget: "list", required: false }
      - { name: "author", label: "Auteur", widget: "string", default: "Alexandre Saint-Jean" }
      - { name: "cover", label: "Image de couverture (1200x630)", widget: "image", required: false }
      - { name: "tldr", label: "En bref (TL;DR, bon pour le GEO)", widget: "text", required: false }
      - name: "sources"
        label: "Sources (liens sortants)"
        widget: "list"
        required: false
        fields:
          - { name: "label", label: "Libellé", widget: "string" }
          - { name: "url", label: "URL", widget: "string" }
      - name: "faq"
        label: "FAQ (extractible par les IA)"
        widget: "list"
        required: false
        fields:
          - { name: "q", label: "Question", widget: "string" }
          - { name: "a", label: "Réponse", widget: "text" }
      - name: "related"
        label: "Pour aller plus loin"
        widget: "object"
        required: false
        fields:
          - { name: "label", label: "Libellé", widget: "string" }
          - { name: "href", label: "Lien (ex: /ia-souveraine)", widget: "string" }
      - { name: "audio", label: "Audio (chemin self-host, ex: /blog/audio/slug.mp3)", widget: "string", required: false }
      - { name: "video", label: "Vidéo (URL YouTube)", widget: "string", required: false }
      - { name: "slides", label: "Slides (URL)", widget: "string", required: false }
      - { name: "body", label: "Corps de l'article", widget: "markdown" }
