backend:
  name: github
  repo: Linaro/linaro-astro
  branch: main
  base_url: "https://gsg44ioab4.execute-api.us-east-1.amazonaws.com"
  auth_endpoint: auth
  squash_merges: true
  cms_label_prefix: cms/

publish_mode: editorial_workflow

media_library:
  name: cloudinary
  config:
    cloud_name: "dl7c2wmhi"
    api_key: "166967243526213"
    folder:
      path: "linaro-website"
      search:
        expression: 'folder="linaro-website/images/blog"'
    upload_preset: DecapConfig

media_folder: ""

collections:
  # Authors collection
  - name: "authors"
    label: "Authors"
    folder: "src/content/authors"
    create: true
    extension: "md"
    format: "frontmatter"
    slug: "{{slug}}"
    identifier_field: "name"
    fields:
      - { label: "Full Name", name: "name", widget: "string" }
      - { label: "First Name", name: "first_name", widget: "string" }
      - { label: "Last Name", name: "last_name", widget: "string" }
      - { label: "Image", name: "image", widget: "image", choose_url: true }
      - { label: "Slug Name", name: "slug_name", widget: string }

  # Tags collection
  - name: "tags"
    label: "Tags"
    folder: "src/content/tags"
    create: true
    extension: "md"
    format: "frontmatter"
    slug: "{{slug}}"
    identifier_field: "name"
    fields:
      - { label: "Name", name: "name", widget: "string" }
      - { label: "Slug Name", name: "slug_name", widget: string }

  # Blog collection
  - name: "blog"
    label: "Blog"
    label_singular: "Post"
    folder: "src/content/blogs"
    create: true
    extension: "mdx"
    format: "frontmatter"
    slug: "{{slug}}"
    summary: "{{title}} — {{date}}"
    sortable_fields: ["date", "title"]
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Description", name: "description", widget: "text" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "utc-datetime",
          format: "YYYY-MM-DDTHH:mm:ss.SSSZ",
        }

      - label: "Author"
        name: "author"
        widget: "relation"
        collection: "authors"
        search_fields: ["name"]
        value_field: "slug_name"
        display_fields: ["name"]

      - label: "Tags"
        name: "tags"
        widget: "relation"
        collection: "tags"
        search_fields: ["name"]
        value_field: "slug_name"
        display_fields: ["name"]
        multiple: true

      - {
          label: "Featured Image",
          name: "image",
          widget: "image",
          choose_url: true,
        }
      - {
          label: "Related",
          name: "related",
          widget: "list",
          default: [],
          field: { label: "Item", name: "item", widget: "string" },
        }
      # Main content
      - { label: "Body", name: "body", widget: "markdown" }

  # News Collection
  - name: "news"
    label: "News"
    label_singular: "Post"
    folder: "src/content/news"
    create: true
    extension: "mdx"
    format: "frontmatter"
    slug: "{{slug}}"
    summary: "{{title}} — {{date}}"
    sortable_fields: ["date", "title"]
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Description", name: "description", widget: "text" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "utc-datetime",
          format: "YYYY-MM-DDTHH:mm:ss.SSSZ",
        }

      - label: "Author"
        name: "author"
        widget: "relation"
        collection: "authors"
        search_fields: ["name"]
        value_field: "slug_name"
        display_fields: ["name"]

      - label: "Tags"
        name: "tags"
        widget: "relation"
        collection: "tags"
        search_fields: ["name"]
        value_field: "slug_name"
        display_fields: ["name"]
        multiple: true

      - {
          label: "Featured Image",
          name: "image",
          widget: "image",
          choose_url: true,
        }
      - {
          label: "Related",
          name: "related",
          widget: "list",
          default: [],
          field: { label: "Item", name: "item", widget: "string" },
        }
      # Main content
      - { label: "Body", name: "body", widget: "markdown" }

    # Careers Collection
  - name: "careers"
    label: "Careers"
    label_singular: "Post"
    folder: "src/content/careers"
    create: true
    extension: "mdx"
    format: "frontmatter"
    slug: "{{slug}}"
    summary: "{{title}} — {{date}}"
    sortable_fields: ["date", "title"]
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "utc-datetime",
          format: "YYYY-MM-DDTHH:mm:ss.SSSZ",
        }
      # Main content
      - { label: "Body", name: "body", widget: "markdown" }
