# Use DecapBridge PKCE auth (required)
backend:
  name: git-gateway
  repo: benyrfg/pravoproumelce
  branch: main
  auth_type: pkce
  base_url: https://auth.decapbridge.com
  auth_endpoint: /sites/0c21b164-a973-45a7-86dd-14bed40d64c8/pkce
  auth_token_endpoint: /sites/0c21b164-a973-45a7-86dd-14bed40d64c8/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://pravoproumelce.cz

local_backend: true

customization:
  path: /admin/highlight.js

media_folder: 'src/assets/images/uploads'
public_folder: 'src/assets/images/uploads'

slug:
  encoding: "ascii"
  clean_accents: true


collections:
  - name: 'post'
    label: 'Články'
    folder: 'src/content/post'
    create: true
    fields:
      - { label: 'Title', name: 'title', widget: 'string' }
      - { label: 'Excerpt', name: 'excerpt', widget: 'text', required: false, preview: false }
      - { label: 'Publish Date', name: 'publishDate', widget: 'datetime', required: false }
      - { label: 'Update Date', name: 'updateDate', widget: 'datetime', required: false }
      - { label: 'Image', name: 'image', widget: 'image', required: false }
      - { label: 'Categories', name: 'categories', widget: 'select', multiple: true, required: true, options: ["Právo pro umělce", "Spisovatel", "Herec", "Muzikant", "Model", "Fotograf", "Programátor", "Architekt", "Kryptobaron", "Malíř", "Sochař", "Influencer", "Jiný umělec" ] }
      - { label: 'Content', name: 'body', widget: 'markdown' }
      - {
          label: 'Tags',
          name: 'tags',
          widget: 'list',
          allow_add: true,
          allow_delete: true,
          collapsed: false,
          field: { label: 'Tag', name: 'tag', widget: 'string' },
          required: false
        }
      - { label: 'Author', name: 'author', widget: 'string', required: false }
      - label: 'Metadata'
        name: 'metadata'
        widget: 'object'
        required: false
        fields:
          - { label: 'Title', name: 'title', widget: 'string', required: false }
          - { label: 'Canonical URL', name: 'canonical', widget: 'string', required: false }         
          - { label: 'Description', name: 'description', widget: 'text', required: false, pattern: ['.{0,160}', "Must have maximum 160 characters"] }  
  - name: 'testimonial'
    label: 'Reference klientů'
    label_singular: 'Reference'
    folder: 'src/content/testimonials'
    create: true
    slug: '{{fields.name | slug}}-{{year}}{{month}}{{day}}{{hour}}{{minute}}{{second}}'
    extension: md
    format: yaml-frontmatter
    fields:
      - { label: 'Text reference', name: 'quote', widget: 'text' }
      - { label: 'Jméno klienta', name: 'name', widget: 'string' }
      - { label: 'Detail', name: 'detail', widget: 'string', required: false }
  - name: 'faq'
    label: 'FAQ'
    label_singular: 'Otázka'
    folder: 'src/content/faq'
    create: true
    slug: '{{fields.question | slug}}'
    extension: md
    format: yaml-frontmatter
    fields:
      - { label: 'Otázka', name: 'question', widget: 'string' }
      - { label: 'Odpověď', name: 'body', widget: 'markdown' }

  - name: 'sluzby'
    label: 'Služby'
    label_singular: 'Služba'
    folder: 'src/content/sluzby'
    create: true
    slug: '{{fields.title | slug}}'
    extension: md
    format: yaml-frontmatter
    fields:
      - { label: 'Název služby', name: 'title', widget: 'string' }
      - { label: 'Popis služby', name: 'body', widget: 'markdown' }
  - name: 'config'
    label: 'Config'
    files: 
      - label: 'Úvod'
        name: 'uvod'
        file: 'src/uvodni-clanek.json'
        create: false
        fields:
          - { label: 'Titulek úvodního článku', name: 'introTitle', widget: 'string' }
          - { label: 'Uvodní článek část na HP' , name: 'introExcerpt', widget: 'markdown' }
          - { label: 'Uvodní článek celý' , name: 'body', widget: 'markdown' }
      - label: 'O nás'
        name: 'o-nas'
        file: 'src/about.json'
        create: false
        fields:
          - { label: 'O nás titulek', name: 'aboutTitle', widget: 'string' }
          - { label: 'O nás - část na HP', name: 'intro', widget: 'markdown' }
          - { label: 'O nás - celý text', name: 'body', widget: 'markdown'}     