backend:
  name: github
  repo: loopino/loopino-blog
  branch: master
  base_url: https://decap-auth.loopino.com.br
  auth_endpoint: /auth
  commit_messages:
    create: 'cms: criar {{collection}} {{slug}}'
    update: 'cms: atualizar {{collection}} {{slug}}'
    delete: 'cms: remover {{collection}} {{slug}}'
    uploadMedia: 'cms: enviar imagem {{path}}'
    deleteMedia: 'cms: remover imagem {{path}}'
    openAuthoring: 'cms: {{message}}'

publish_mode: editorial_workflow
media_folder: public/images/blog/uploads
public_folder: /images/blog/uploads
site_url: https://blog.loopino.com.br
display_url: https://blog.loopino.com.br
logo_url: /loopino-logo.png
slug:
  encoding: ascii
  clean_accents: true
  sanitize_replacement: '-'

collections:
  - name: blog
    label: Posts publicados
    label_singular: Post
    description: Posts publicados em src/content/blog/posts/. A URL publica usa somente o campo slug.
    folder: src/content/blog/posts
    path: "{{publishedAt | date('YYYY')}}/{{fields.slug}}"
    create: true
    delete: false
    extension: md
    format: frontmatter
    identifier_field: title
    slug: '{{fields.slug}}'
    preview_path: '{{fields.slug}}/'
    preview_path_date_field: publishedAt
    summary: '{{publishedAt}} - {{title}}'
    sortable_fields:
      - publishedAt
      - title
      - category
      - author
      - featured
      - commit_date
    view_groups:
      - label: Ano
        field: publishedAt
        pattern: \d{4}
      - label: Categoria
        field: category
    view_filters:
      - label: Destaques
        field: featured
        pattern: true
    nested:
      depth: 2
      summary: '{{dirname}}'
      subfolders: false
    fields:
      - label: Titulo
        name: title
        widget: string
      - label: Slug publico
        name: slug
        widget: string
        hint: 'Nao altere slugs de posts migrados. A URL publica sera /slug/.'
        pattern:
          - '^[a-z0-9]+(?:-[a-z0-9]+)*$'
          - 'Use apenas letras minusculas, numeros e hifens, sem barras.'
      - label: Resumo
        name: excerpt
        widget: text
      - label: Categoria
        name: category
        widget: select
        options:
          - { label: 'Back-end', value: 'backend' }
          - { label: 'Front-end', value: 'frontend' }
          - { label: 'DevOps & Infra', value: 'devops' }
          - { label: 'Cybersecurity', value: 'cybersecurity' }
          - { label: 'Qualidade de Software', value: 'qualidade' }
          - { label: 'IA', value: 'ia' }
          - { label: 'Java', value: 'java' }
          - { label: 'JavaScript', value: 'javascript' }
          - { label: 'React', value: 'react' }
      - label: Tags
        name: tags
        widget: list
        field:
          label: Tag
          name: tag
          widget: string
        default: []
      - label: Autor
        name: author
        widget: select
        options:
          - { label: 'Marcos Costa', value: 'marcos-costa' }
          - { label: 'Pedro Mendes', value: 'pedro-mendes' }
          - { label: 'Washigton Silva', value: 'washigton-silva' }
      - label: Data de publicacao
        name: publishedAt
        widget: datetime
        date_format: 'YYYY-MM-DD'
        time_format: false
        format: 'YYYY-MM-DD'
        picker_utc: true
      - label: Tempo de leitura
        name: readTime
        widget: string
        hint: 'Exemplo: 5 min'
        pattern:
          - "^\\d+\\s+min$"
          - 'Use o formato: 5 min'
      - label: Imagem principal
        name: image
        widget: image
      - label: Texto alternativo da imagem
        name: imageAlt
        widget: string
      - label: Destaque
        name: featured
        widget: boolean
        default: false
      - label: Conteudo
        name: body
        widget: markdown

  - name: drafts
    label: Rascunhos
    label_singular: Rascunho
    description: Rascunhos em src/content/blog/drafts/. Esta pasta nao entra na collection publica do Astro.
    folder: src/content/blog/drafts
    path: "{{publishedAt | date('YYYY')}}/{{fields.slug}}"
    create: true
    delete: true
    extension: md
    format: frontmatter
    identifier_field: title
    slug: '{{fields.slug}}'
    summary: '{{publishedAt}} - {{title}}'
    nested:
      depth: 2
      summary: '{{dirname}}'
      subfolders: false
    fields:
      - label: Titulo
        name: title
        widget: string
      - label: Slug publico futuro
        name: slug
        widget: string
        hint: 'Use o slug final desde o rascunho para evitar troca de URL ao publicar.'
        pattern:
          - '^[a-z0-9]+(?:-[a-z0-9]+)*$'
          - 'Use apenas letras minusculas, numeros e hifens, sem barras.'
      - label: Resumo
        name: excerpt
        widget: text
      - label: Categoria
        name: category
        widget: select
        options:
          - { label: 'Back-end', value: 'backend' }
          - { label: 'Front-end', value: 'frontend' }
          - { label: 'DevOps & Infra', value: 'devops' }
          - { label: 'Cybersecurity', value: 'cybersecurity' }
          - { label: 'Qualidade de Software', value: 'qualidade' }
          - { label: 'IA', value: 'ia' }
          - { label: 'Java', value: 'java' }
          - { label: 'JavaScript', value: 'javascript' }
          - { label: 'React', value: 'react' }
      - label: Tags
        name: tags
        widget: list
        field:
          label: Tag
          name: tag
          widget: string
        default: []
      - label: Autor
        name: author
        widget: select
        options:
          - { label: 'Marcos Costa', value: 'marcos-costa' }
          - { label: 'Pedro Mendes', value: 'pedro-mendes' }
          - { label: 'Washigton Silva', value: 'washigton-silva' }
      - label: Data de publicacao planejada
        name: publishedAt
        widget: datetime
        date_format: 'YYYY-MM-DD'
        time_format: false
        format: 'YYYY-MM-DD'
        picker_utc: true
      - label: Tempo de leitura
        name: readTime
        widget: string
        hint: 'Exemplo: 5 min'
        pattern:
          - "^\\d+\\s+min$"
          - 'Use o formato: 5 min'
      - label: Imagem principal
        name: image
        widget: image
      - label: Texto alternativo da imagem
        name: imageAlt
        widget: string
      - label: Destaque
        name: featured
        widget: boolean
        default: false
      - label: Conteudo
        name: body
        widget: markdown
