


local_backend: true



backend:

  name: git-gateway
  repo: Platoniq/wilder-journal
  branch: main
  squash_merges: true

locale: es

media_folder: "media"

# publish_mode: editorial_workflow # Enable drafts

i18n:
  # Required and can be one of multiple_folders, multiple_files or single_file
  # multiple_folders - persists files in `<folder>/<locale>/<slug>.<extension>`
  # multiple_files - persists files in `<folder>/<slug>.<locale>.<extension>`
  # single_file - persists a single file in `<folder>/<slug>.<extension>`
  structure: multiple_folders

  # Required - a list of locales to show in the editor UI
  locales: &locales [es, en]

  # Optional, defaults to the first item in locales.
  # The locale to be used for fields validation and as a baseline for the entry.
  default_locale: es



collections:

  

  
- name: "volumes"
  label: "Volúmenes"
  label_singular: "Volumen"
  folder: "_volumes/"
  i18n:
    structure: multiple_folders
    locales: *locales
  create: true
  delete: true
  editor:
    preview: true
  # identifier_field: uid
  summary: "#{{volume-number}}: {{title}} ({{date}})"
  fields:
    - label: Publicado
      name: published
      widget: boolean
      default: false
      i18n: duplicate
      
    - label: "Fecha de publicación"
      name: date
      widget: date
      i18n: duplicate

    - label: Layout
      name: layout
      widget: hidden
      default: journal
      i18n: duplicate
      
    - label: "Número de volumen del Journal"
      name: volume-number
      widget: number
      default: 0
      value_type: int
      min: 1
      max: 101
      step: 1
      i18n: duplicate
      
    - label: Título
      name: title
      widget: string
      i18n: translate

    - label: Slug
      name: uid
      hint: "Identificador único, compartido entre los distintos idiomas, que se usa para componer la URL"
      widget: string
      i18n: duplicate

    - label: "Imagen de portada"
      name: "cover"
      widget: "object"
      i18n: true
      fields:
        - {
            label: "Portada",
            hint: Imagen de portada,
            name: "path",
            widget: "image",
            choose_url: false,
            default: "/assets/media/no_image-hero.png",
            media_library: { config: { multiple: false } },
            media_folder: "/media/volumes/heroes",
            i18n: duplicate
          }
        - {
            label: "Portada (móvil)",
            hint: Portada para móvil en formato vertical,
            name: "mobile",
            widget: "image",
            choose_url: false,
            default: "/assets/media/no_image-hero.png",
            media_library: { config: { multiple: false } },
            media_folder: "/media/volumes/mobile",
            i18n: duplicate
          }
        - {
            label: "Portada (reducida)",
            hint: Imagen pequeña usada en listas,
            name: "thumbnail",
            widget: "image",
            choose_url: false,
            default: "/assets/media/no_image-hero.png",
            media_library: { config: { multiple: false } },
            media_folder: "/media/volumes/thumbnails",
            i18n: duplicate
          }
        - { label: "Texto alternativo a la imagen", name: "alt", widget: "string", i18n: translate }
        - { label: "Créditos de la imagen", name: "credits", widget: "string", i18n: translate }

    - label: Descripción o resumen de este volumen del Journal
      hint: "Principalmente usado para SEO"
      name: description
      widget: string
      i18n: translate
  
    - label: "Imagen de previsualización"
      name: image
      hint: Se verá cuando el artículo sea compartido en redes sociales, como previsualización del enlace
      widget: object
      i18n: true
      required: false
      fields:
        - label: Imagen
          hint: "Las imágenes para las 'summary cards' deben ser de 144px × 144px y de un tamaño menor o igual a 1MB."
          name: path
          widget: image
          default: "/assets/media/no_image-social_media.png"
          media_library: { config: { multiple: false } }
          media_folder: "/media/volumes/social"
          i18n: duplicate

        - label: "Texto alternativo a la imagen"
          name: alt
          widget: string
          i18n: translate



  

  
- name: "articles"
  label: "Artículos"
  label_singular: "Artículo"
  folder: "_articles/"
  i18n:
    structure: multiple_folders
    locales: *locales
  create: true # Allow users to create new documents in this collection
  slug: "{{uid}}" # Filename template, e.g., YYYY-MM-DD-title.md
  summary: "{{title}} [{{category}} / {{author}}]"
  sort: "article-order:asc"
  view_filters:
    - label: Futures
      field: category
      pattern: futures
    - label: Deep Dives
      field: category
      pattern: "deep-dives"
    - label: Interviews
      field: category
      pattern: "interviews"
    - label: Learnings
      field: category
      pattern: "learnings"
    - label: Stories
      field: category
      pattern: "stories"
    - label: Services
      field: category
      pattern: "services"
    - label: Rethink
      field: category
      pattern: "rethink"
    - label: Published
      field: published
      pattern: true
    - label: Unpublished
      field: "published"
      pattern: false
    - label: Featured
      field: featured
      pattern: true
    - label: "#1"
      field: volume-uid
      pattern: "1"
    - label: "#2"
      field: volume-uid
      pattern: "2"
  view_groups:
    - label: Volumen del Journal
      field: volume-uid
    - label: Categoría
      field: category
    - label: Publicado
      field: published
    - label: Call to action
      field: call_to_action
    - label: Autoría
      field: author
  editor:
    preview: true
  sortable_fields: ["article-order", "title", "volume-uid"]
  fields: # The fields for each document, usually in front matter
    - { label: "Layout", name: "layout", widget: "hidden", default: "article", i18n: duplicate }
    - {
      label: "Volumen del Journal",
      name: "volume-uid",
      widget: "relation",
      collection: "volumes",
      display_fields: [title],
      search_fields: [title],
      value_field: "uid",
      i18n: duplicate,
      required: false
    }
    - {
      label: "Categoría",
      name: "category",
      widget: "select",
      options: [
        { label: "Futuros", value: "futures" },
        { label: "Deep dives", value: "deep-dives" },
        { label: "Interviews", value: "interviews" },
        { label: "Learnings", value: "learnings" },
        { label: "Stories", value: "stories" },
        { label: "Services", value: "services" },
        { label: "Repiénsate", value: "rethink" }
      ],
      i18n: duplicate
    }
    - { label: "Publicado", name: "published", widget: "boolean", default: false, i18n: duplicate }
    - { label: "Destacado", name: "featured", hint: "Resáltalo en la parte superior de la página del volumen", widget: "boolean", default: false, i18n: duplicate }
    - { label: "Fecha de publicación", name: "date", widget: "datetime", i18n: duplicate }
    - { label: "Fecha de actualización", name: "date-updated", widget: "datetime", i18n: duplicate }
    - { label: "Orden del artículo", name: "article-order", widget: "number", default: 0, value_type: "int", min: 1, max: 101, step: 1, i18n: duplicate }
    - { label: "Slug", name: "uid", widget: "string", i18n: duplicate }
    - { label: "Título", name: "title", widget: "string", i18n: translate }
    - label: "Descripción o resumen del artículo"
      hint: "Principalmente usada para SEO"
      name: "description"
      widget: "string"
      i18n: translate
    - label: "Autoría"
      name: "author"
      widget: "string"
      i18n: translate
    - label: "Autoras"
      name: author_uids
      widget: "list"
      required: true
      i18n: true
      summary: "{{fields.author_uid}}"
      field:
        label: "Autora"
        name: author_uid
        widget: relation
        collection: authors
        display_fields: [name]
        search_fields: [name, uid]
        value_field: uid
        i18n: duplicate
    - label: Entrevistadx
      name: "interviewee"
      hint: "Añadir el nombre de la persona entrevistada, si la categoría es 'Interviews'"
      widget: "string"
      required: false
      i18n: duplicate
    
    - label: "Portada"
      name: "cover"
      widget: "object"
      i18n: true
      fields:
        - {
            label: "Portada",
            hint: Imagen de portada,
            name: "path",
            widget: "image",
            choose_url: false,
            default: "/assets/media/no_image-hero.png",
            media_library: { config: { multiple: false } },
            media_folder: "/media/articles/heroes",
            i18n: duplicate
          }
        - {
            label: "Portada (móvil)",
            hint: Portada para móvil en formato vertical,
            name: "mobile",
            widget: "image",
            choose_url: false,
            default: "/assets/media/no_image-hero.png",
            media_library: { config: { multiple: false } },
            media_folder: "/media/articles/mobile",
            i18n: duplicate
          }
        - {
            label: "Portada (reducida)",
            hint: Imagen pequeña usada en listas,
            name: "thumbnail",
            widget: "image",
            choose_url: false,
            default: "/assets/media/no_image-thumbnail.png",
            media_library: { config: { multiple: false } },
            media_folder: "/media/articles/thumbnails",
            i18n: duplicate
          }
        - { label: "Texto alternativo a la imagen", name: "alt", widget: "string", i18n: translate }
        - { label: "Créditos de la imagen", name: "credits", widget: "string", i18n: translate }
        - { label: "Pie de imagen", name: "caption", widget: "string", i18n: translate }
    - label: "Contenido del artículo"
      name: "body"
      widget: "markdown"
      editor_components: ["gallery", "quote-tag", "file-tag", "documents-tag", "links-tag", "numbers-tag", "questions-tag"]
      i18n: true
    - label: "Artículos relacionados"
      name: related_article_uids
      widget: "list"
      required: false
      i18n: false # todo: duplicate to other locales
      summary: "{{fields.related_article_uid}}"
      field:
        label: "Artículo relacionado"
        name: related_article_uid
        widget: relation
        collection: articles
        display_fields: ["{{title}} [{{category}} / {{author}}]"]
        search_fields: [title, uid]
        value_field: uid
        i18n: duplicate
    - label: "Stickers"
      name: "stickers"
      widget: "object"
      collapsed: true
      i18n: true
      fields:
        - label: "Posición de los stickers"
          name: layout
          widget: select
          default: layout-none
          options:
            - label: Sin stickers
              value: layout-none
            - label: ↖️ + ↘️ Superior izquierda, inferior derecha
              value: layout-one
            - label: ↙️ + ↗️ Inferior izquieda, superior derecha
              value: layout-two
          i18n: duplicate
        - label: Sticker Uno
          name: sticker_one
          widget: relation
          collection: stickers
          display_fields: [emoji]
          search_fields: [name]
          value_field: path
          i18n: duplicate
          required: false
        - label: "Sticker Uno: Animación"
          name: sticker_one_animation
          widget: select
          default: animation-none
          options: &sticker-animations
            - label: Sin animación
              value: animation-none
            - label: Glitch
              value: animation-glitch
            - label: Breathe
              value: animation-breathe
          i18n: duplicate
        - label: Sticker Dos
          name: sticker_two
          widget: relation
          collection: stickers
          display_fields: [emoji]
          search_fields: [name]
          value_field: path
          i18n: duplicate
          required: false
        - label: "Sticker Dos: Animación"
          name: sticker_two_animation
          widget: select
          default: animation-none
          options: *sticker-animations
          i18n: duplicate
    - label: "Call to action"
      name: call_to_action
      widget: relation
      collection: call_to_actions
      display_fields: [uid]
      search_fields: [uid]
      value_field: uid
      i18n: duplicate
    - label: "Imagen de previsualización"
      name: image
      hint: Se verá cuando el artículo sea compartido en redes sociales, como previsualización del enlace
      widget: object
      i18n: true
      required: false
      fields:
        - label: Imagen
          hint: "Las imágenes para las 'summary cards' deben ser de 144px × 144px y de un tamaño menor o igual a 1MB."
          name: path
          widget: image
          default: "/assets/media/no_image-social_media.png"
          media_library: { config: { multiple: false } }
          media_folder: "/media/articles/social"
          i18n: duplicate



  

  
- name: "videos"
  label: "Vídeos"
  label_singular: "Vídeo"
  folder: "_videos/"
  i18n:
    structure: multiple_folders
    locales: *locales
  create: true
  delete: true
  slug: "{{uid}}"
  summary: "{{title}} [{{volume-uid}}]"
  sort: "video-order:asc"
  view_filters:
    - label: Destacado
      field: featured
      pattern: true
    - label: Publicado
      field: published
      pattern: true
    - label: No publicado
      field: published
      pattern: false
    - label: "#1"
      field: volume-uid
      pattern: "1"
    - label: "#2"
      field: volume-uid
      pattern: "2"
  view_groups:
    - label: Volumen del Journal
      field: volume-uid
    - label: Publicado
      field: published
  editor:
    preview: false
  sortable_fields: ["video-order", "title", "volume-uid"]
  fields:
    - { label: "Publicado", name: "published", widget: "boolean", default: false, i18n: duplicate }
    - { label: "Slug", name: "uid", widget: "string", i18n: duplicate }
    - { label: "Título", name: "title", widget: "string", i18n: translate }
    - {
        label: "Descripción",
        name: "description",
        widget: "text",
        required: false,
        i18n: translate
      }
    - {
        label: "URL del vídeo (YouTube)",
        name: "youtube_url",
        hint: "Pega la URL del vídeo (formato embed, watch o youtu.be). La miniatura se genera automáticamente.",
        widget: "string",
        i18n: duplicate
      }
    - {
        label: "Miniatura (opcional)",
        name: "thumbnail",
        hint: "Solo si quieres reemplazar la miniatura automática de YouTube (p. ej. para vídeos de Vimeo).",
        widget: "image",
        required: false,
        choose_url: true,
        media_library: { config: { multiple: false } },
        media_folder: "/media/videos/thumbnails",
        i18n: duplicate
      }
    - { label: "Fecha", name: "date", widget: "datetime", i18n: duplicate }
    - { label: "Orden", name: "video-order", widget: "number", default: 0, value_type: "int", min: 1, max: 101, step: 1, i18n: duplicate }
    - {
        label: "Volumen del Journal",
        name: "volume-uid",
        widget: "relation",
        collection: "volumes",
        display_fields: [title],
        search_fields: [title],
        value_field: "uid",
        required: false,
        i18n: duplicate
      }
    - {
        label: "Artículo relacionado",
        name: "related_article_uid",
        hint: "Vincula este vídeo a un artículo del Journal.",
        widget: "relation",
        collection: "articles",
        display_fields: ["{{title}} [{{category}} / {{author}}]"],
        search_fields: [title, uid],
        value_field: "uid",
        required: false,
        i18n: duplicate
      }
    - { label: "Destacado", name: "featured", widget: "boolean", default: false, i18n: duplicate }



  

  
- name: pages
  label: Páginas
  label_singular: Página
  folder: "_pages/"
  slug: "{{uid}}"
  i18n:
    structure: multiple_folders
    locales: *locales
  create: true
  editor:
    preview: true
  fields:
    - label: Publicada
      name: published
      widget: boolean
      default: false
      i18n: duplicate

    - label: Slug
      name: uid
      widget: string
      i18n: duplicate

    - label: Título
      name: title
      widget: string
      i18n: translate

    - label: Descripción o resumen de la página
      hint: Principalmente usada para SEO
      name: description
      widget: string
      i18n: translate

    - label: Contenido de la página
      name: body
      widget: markdown
      editor_components: ["gallery", "quote-tag", "file-tag", "documents-tag", "links-tag"]
      i18n: true

    - label: "Call to action"
      name: call_to_action
      widget: relation
      collection: call_to_actions
      display_fields: [uid]
      search_fields: [uid]
      value_field: uid
      i18n: duplicate



  

  
- name: "authors"
  label: "Autorías"
  label_singular: "Autoría"
  folder: "_authors/"
  i18n:
    structure: multiple_folders
    locales: *locales
  create: true
  editor:
    preview: false
  fields:
    - label: Slug
      name: uid
      hint: "Identificador único, compartido entre los distintos idiomas, que se usa para componer la URL"
      widget: string
      i18n: duplicate

    - label: Layout
      name: layout
      widget: hidden
      default: author
      i18n: duplicate

    - label: Nombre
      name: name
      widget: string
      i18n: duplicate

    - label: Rol en la organización
      name: position
      widget: string
      i18n: translate

    - label: Cuerpo de la página
      name: body
      widget: markdown
      i18n: translate

    - label: Imagen
      name: image
      widget: object
      i18n: true
      fields:
        - label: Imagen
          name: path
          widget: image
          choose_url: false
          default: "/assets/media/no_image-hero.png"
          media_library: { config: { multiple: false } }
          media_folder: "/media/authors"
          i18n: duplicate
        - label: Texto alternativo a la imagen
          name: alt
          widget: string
          i18n: translate



  

  
- name: "call_to_actions"
  label: "Call to Actions"
  editor:
    preview: false
  files:
    - label: "Contacto"
      name: "contact"
      file: "_call_to_actions/contact.md"
      fields:
        - label: CTA Contact English
          name: en
          widget: object
          fields: &cta_contact_fields
            - label: Título
              name: title
              widget: string
            - label: Contenido
              name: content
              widget: text
            - label: Botón
              name: button
              widget: object
              fields:
                - label: Texto
                  name: label
                  widget: string
            - label: Imagen
              name: image
              widget: object
              fields:
                - label: Imagen
                  name: path
                  widget: image
                  default: "/assets/media/no_image-cta.png"
                  media_library: { config: { multiple: false } }
                  media_folder: "/media/call_to_actions/"
                - label: Texto alternativo a la imagen
                  name: alt
                  widget: string

        - label: "CTA Contact Español"
          name: es
          widget: object
          fields: *cta_contact_fields

    - label: Donación
      name: donate
      editor:
        preview: false
      file: "_call_to_actions/donate.md"
      fields:
        - label: CTA Donate English
          name: en
          widget: object
          fields: &cta_donate_fields
            - label: Título
              name: title
              widget: string
            - label: Contenido
              name: content
              widget: text
            - label: Botón
              name: button
              widget: object
              fields:
                - label: Texto
                  name: label
                  widget: string
                - label: Enlace
                  name: link
                  hint: "Inserta una URL válida, por ejemplo 'https://www.goteo.org'"
                  widget: string
            - label: Imagen
              name: image
              widget: object
              fields:
                - label: Imagen
                  name: path
                  widget: image
                  default: "/assets/media/no_image-cta.png"
                  media_library: { config: { multiple: false } }
                  media_folder: "/media/call_to_actions/"
                - label: Texto alternativo a la imagen
                  name: alt
                  widget: string

        - label: "CTA Donate Español"
          name: es
          widget: object
          fields: *cta_donate_fields

    - label: Newsletter
      name: newsletter
      editor:
        preview: false
      file: "_call_to_actions/newsletter.md"
      fields:
        - label: CTA Newsletter English
          name: en
          widget: object
          fields: &cta_newsletter_fields
            - label: Título
              name: title
              widget: string
            - label: Contenido
              name: content
              widget: text
            - label: Botón
              name: button
              widget: object
              fields:
                - label: Texto
                  name: label
                  widget: string
            - label: Imagen
              name: image
              widget: object
              fields:
                - label: Imagen
                  name: path
                  widget: image
                  default: "/assets/media/no_image-cta.png"
                  media_library: { config: { multiple: false } }
                  media_folder: "/media/call_to_actions/"
                - label: Texto alternativo a la imagen
                  name: alt
                  widget: string
            - label: Enviado
              name: filled
              hint: El contenido de esta sección cuando se ha enviado el formulario
              widget: object
              fields:
                - label: Título
                  name: title
                  widget: string
                - label: Contendio
                  name: content
                  widget: text

        - label: "CTA Newsletter Español"
          name: es
          widget: object
          fields: *cta_newsletter_fields



  

  
- name: "stickers"
  label: "Stickers"
  label_singular: "Sticker"
  folder: "_stickers/"
  create: false
  delete: false
  i18n:
    structure: multiple_folders
    locales: *locales
  editor:
    preview: true
  fields:
    - label: Volumen del Journal
      name: volume-uid
      widget: hidden
      collection: volumes
      display_fields:
        - title
      search_fields:
        - title
      value_field: uid
      i18n: duplicate
    - label: Path
      name: path
      widget: hidden
    - label: Nombre descriptivo
      name: name
      widget: string
      i18n: translate
    - label: Emoji
      name: emoji
      widget: string



  

  
- name: "sticker_pack"
  label: "Packs de Stickers"
  label_singular: "Pack de Stickers"
  folder: "_sticker_packs/"
  create: false
  delete: false
  i18n:
    structure: multiple_folders
    locales: *locales
  # editor:
  #   preview: true
  # identifier_field: uid
  fields:
    - { label: "Layout", name: "layout", widget: "hidden", default: "sticker_pack", i18n: duplicate }
    - label: Volumen del Journal
      name: volume-uid
      widget: hidden
      i18n: duplicate
    - {
      label: "Autoría de la página",
      name: "author",
      widget: "string",
      i18n: translate
    }
    - label: Autoría del pack de stickers
      name: stickers_author
      widget: string
      i18n: translate
    - label: "Autoras"
      name: author_uids
      widget: "list"
      required: true
      i18n: true
      summary: "{{fields.author_uid}}"
      field:
        label: "Autora"
        name: author_uid
        widget: relation
        collection: authors
        display_fields: [name]
        search_fields: [name, uid]
        value_field: uid
        i18n: duplicate
    - label: Título de la página
      name: title
      widget: string
      i18n: translate
    - label: Título de la página para el menú
      name: title_menu
      widget: string
      i18n: translate
    - label: Descripción o resumen de la página
      hint: Principalmente usada para SEO
      name: description
      widget: string
      i18n: translate
    - label: Contenido de la página de stickers
      name: body
      widget: markdown
      editor_components: ["gallery", "quote-tag", "file-tag", "documents-tag", "links-tag"]
      i18n: translate
    - label: Portada
      name: "cover"
      widget: "object"
      i18n: true
      fields:
        - {
            label: "Portada",
            hint: Imagen de portada,
            name: "path",
            widget: "image",
            choose_url: false,
            default: "/assets/media/no_image-hero.png",
            media_library: { config: { multiple: false } },
            media_folder: "/media/sticker_packs/heroes/",
            i18n: duplicate
          }
        - {
            label: "Portada (reducida)",
            hint: Imagen pequeña usada en listas,
            name: "thumbnail",
            widget: "image",
            choose_url: false,
            default: "/assets/media/no_image-thumbnail.png",
            media_library: { config: { multiple: false } },
            media_folder: "/media/sticker_packs/thumbnails/",
            i18n: duplicate
          }
        - { label: "Texto alternativo a la imagen", name: "alt", widget: "string", i18n: translate }
        - { label: "Créditos de la imagen", name: "credits", widget: "string", i18n: translate }
        - { label: "Pie de imagen", name: "caption", widget: "string", i18n: translate }



