# Decap CMS configuration
# Docs: https://decapcms.org/docs/configuration-options/

backend:
  name: github
  repo: inue-edu-mx/inue.edu.mx
  branch: main
  # OAuth proxy that exchanges GitHub's auth code for a token.
  # Replace with the URL of your deployed proxy (e.g. https://oauth.inue.edu.mx).
  # See decaporator / oauth-cloudflare-worker for free hosting options.
  base_url: https://oauthinueedumx-production.up.railway.app
  auth_endpoint: auth

# Editorial workflow: posts go through draft -> in review -> ready
# before being merged to main. Recommended for multi-author teams.
publish_mode: editorial_workflow

# Where uploaded images live. Decap commits them to this path in the repo;
# the site references them at /uploads/<filename>.
media_folder: public/uploads
public_folder: /uploads

# Local backend lets editors preview the CMS without OAuth, by running
# `npx decap-server` alongside `astro dev`. Comment out for production-only.
local_backend: true

site_url: https://inue.edu.mx
display_url: https://inue.edu.mx
logo_url: /favicon.svg

collections:
  - name: blog
    label: Blog
    label_singular: Artículo
    folder: src/content/blog
    create: true
    slug: "{{slug}}"
    extension: md
    format: frontmatter
    summary: "{{title}} — {{date | date('YYYY-MM-DD')}}"
    sortable_fields: [date, title]
    view_filters:
      - label: Borradores
        field: draft
        pattern: true
      - label: Publicados
        field: draft
        pattern: false
    fields:
      - { name: title, label: Título, widget: string }
      - { name: date, label: Fecha de publicación, widget: datetime }
      - {
          name: author,
          label: Autor,
          widget: string,
          required: false,
        }
      - {
          name: description,
          label: Descripción corta,
          widget: text,
          required: false,
          hint: "Aparece en listados y en metadatos para SEO. ~160 caracteres.",
        }
      - {
          name: cover,
          label: Imagen de portada,
          widget: image,
          required: false,
        }
      - {
          name: categories,
          label: Categorías,
          widget: list,
          required: false,
          default: [],
          hint: "Taxonomía principal. Mantén el vocabulario corto (≤10).",
        }
      - {
          name: tags,
          label: Etiquetas,
          widget: list,
          required: false,
          default: [],
        }
      - {
          name: draft,
          label: Borrador,
          widget: boolean,
          default: true,
          hint: "Si está activo, el artículo no aparece en producción.",
        }
      - {
          name: legacyUrl,
          label: URL legado (Squarespace),
          widget: string,
          required: false,
          hint: "Solo para posts migrados. No editar.",
        }
      - { name: body, label: Contenido, widget: markdown }
