backend:
  name: github
  repo: engelina8/FoxyRecipes
  branch: main
  # GitHub Pages needs an external OAuth proxy for Decap CMS login.
  base_url: https://foxy-recipes.foxyrecipes.workers.dev
  auth_endpoint: auth

site_url: https://foxyrecipes.snowmoon.eu
display_url: https://foxyrecipes.snowmoon.eu

media_folder: "public/uploads"
public_folder: "/uploads"

collections:
  - name: "recipes"
    label: "Recipes"
    folder: "src/content/recipes"
    create: true
    slug: "{{slug}}"
    fields:
      - { name: "title", label: "Title", widget: "string" }
      - { name: "description", label: "Description", widget: "text" }
      - {
          name: "servings",
          label: "Servings",
          widget: "number",
          required: false,
        }
      - {
          name: "prepTime",
          label: "Prep Time",
          widget: "string",
          required: false,
        }
      - name: "ingredients"
        label: "Ingredients"
        widget: "list"
        fields:
          - {
              name: "amount",
              label: "Amount",
              widget: "string",
              required: false,
            }
          - { name: "unit", label: "Unit", widget: "string", required: false }
          - { name: "name", label: "Ingredient", widget: "string" }
      - name: "steps"
        label: "Steps"
        widget: "list"
        field:
          name: "step"
          widget: "text"
      - name: "tags"
        label: "Tags"
        widget: "list"
        field:
          name: "tag"
          widget: "string"
      - name: "macros"
        label: "Macros"
        widget: "object"
        fields:
          - {
              name: "calories",
              label: "Calories",
              widget: "number",
              required: false,
            }
          - {
              name: "protein",
              label: "Protein (g)",
              widget: "number",
              required: false,
            }
          - {
              name: "carbs",
              label: "Carbs (g)",
              widget: "number",
              required: false,
            }
          - { name: "fat", label: "Fat (g)", widget: "number", required: false }
      - {
          name: "coverImage",
          label: "Cover Image",
          widget: "image",
          required: false,
        }

  - name: "meal_plans"
    label: "Meal Plans"
    folder: "src/content/meal-plans"
    create: true
    slug: "{{slug}}"
    fields:
      - { name: "weekTitle", label: "Week Title", widget: "string" }
      - name: "days"
        label: "Days"
        widget: "list"
        fields:
          - name: "day"
            label: "Day"
            widget: "select"
            options:
              - Monday
              - Tuesday
              - Wednesday
              - Thursday
              - Friday
              - Saturday
              - Sunday
          - name: "breakfast"
            label: "Breakfast"
            widget: "list"
            field:
              name: "recipe"
              widget: "relation"
              collection: "recipes"
              search_fields: ["title"]
              value_field: "slug"
              display_fields: ["title"]
          - name: "lunch"
            label: "Lunch"
            widget: "list"
            field:
              name: "recipe"
              widget: "relation"
              collection: "recipes"
              search_fields: ["title"]
              value_field: "slug"
              display_fields: ["title"]
          - name: "dinner"
            label: "Dinner"
            widget: "list"
            field:
              name: "recipe"
              widget: "relation"
              collection: "recipes"
              search_fields: ["title"]
              value_field: "slug"
              display_fields: ["title"]
          - name: "snack"
            label: "Snack"
            widget: "list"
            field:
              name: "recipe"
              widget: "relation"
              collection: "recipes"
              search_fields: ["title"]
              value_field: "slug"
              display_fields: ["title"]
