# Developer configuration. The owner only sees the three content collections below.
# Public UUID from the Decap Turbo site's Overview tab; replace when cloning.
# In Turbo, set Config path to public/admin/config.yml (the source path in Git).
backend:
  name: turbo-github
  turbo_site_id: "21561eee-0607-42c9-ac7d-b7c048da544e"
  branch: main

site_url: https://cafe-website-demo.pages.dev
display_url: https://cafe-website-demo.pages.dev

# The Turbo dashboard is authoritative for the repository. Do not add repo,
# base_url, auth_endpoint, Netlify Identity, or OAuth secrets here.
publish_mode: simple
media_folder: public/uploads
public_folder: /uploads
# Use the built-in Git-backed media library. Upload limits belong on image
# fields below; a top-level media_library object selects a named integration.
editor:
  preview: false
slug:
  encoding: ascii
  clean_accents: true
  sanitize_replacement: "-"

collections:
  - name: menu
    label: Menu
    label_singular: Menu item
    description: "Edit a price, save and publish. Your website updates after the next deployment."
    folder: content/menu
    create: true
    delete: true
    extension: json
    format: json
    identifier_field: name
    slug: "{{slug}}"
    summary: "{{name}} · ${{price}} · {{category}}"
    sortable_fields: [name, category, price]
    fields:
      - label: Item name
        name: name
        widget: string
        pattern: ['^(?=\s*\S)[\s\S]{1,80}$', 'Enter an item name, up to 80 characters.']
      - label: Description
        name: description
        widget: text
        pattern: ['^(?=\s*\S)[\s\S]{1,300}$', 'Enter a description, up to 300 characters.']
      - label: Price (USD)
        name: price
        widget: number
        value_type: float
        min: 0
        max: 999.99
        step: 0.01
        pattern: ['^\d+(\.\d{1,2})?$', 'Enter a price with no more than two decimal places.']
        hint: "Numbers only, without a dollar sign. Example: 4.50."
      - label: Category
        name: category
        widget: select
        options: [Coffee & tea, Bakery, Kitchen]
        default: Coffee & tea
      - &image_field
        label: Image
        name: image
        widget: image
        required: false
        choose_url: false
        allow_multiple: false
        # Decap validates the basename (toast.jpg), not the stored /uploads/toast.jpg path.
        # Full path and file existence are checked separately by the site build.
        pattern: ['^[\w ().-]+\.(jpg|jpeg|png|webp|gif|JPG|JPEG|PNG|WEBP|GIF)$', 'Choose a JPG, PNG, WebP or GIF. Use a simple filename.']
        hint: "Optional. Upload a JPG, PNG, WebP or GIF under 2 MB. Use a simple filename, such as oat-latte.jpg."
        media_library:
          config:
            max_file_size: 2000000
      - &image_alt_field
        label: Image description
        name: image_alt
        widget: string
        required: false
        pattern: ['^[\s\S]{0,160}$', 'Use up to 160 characters.']
        hint: "Describe the image for people using screen readers. Leave blank if purely decorative."
      - label: Available
        name: available
        widget: boolean
        default: true
        hint: "Turn off to show Currently unavailable on the menu. The item will also leave the featured section."
      - label: Featured
        name: featured
        widget: boolean
        default: false
        hint: "Show this item in house favorites when it is available. Three favorites work well."

  - name: cafe
    label: Café information
    files:
      - name: details
        label: Café information
        file: content/cafe.json
        fields:
          - {label: Café name, name: name, widget: string, pattern: ['^(?=\s*\S)[\s\S]{1,80}$', 'Enter a name, up to 80 characters.']}
          - {label: Short description, name: description, widget: text, pattern: ['^(?=\s*\S)[\s\S]{1,240}$', 'Enter a description, up to 240 characters.']}
          - {label: Welcome headline, name: hero_title, widget: string, pattern: ['^(?=\s*\S)[\s\S]{1,100}$', 'Enter a headline, up to 100 characters.']}
          - {label: Our story, name: introduction, widget: text, pattern: ['^(?=\s*\S)[\s\S]{1,900}$', 'Enter your introduction, up to 900 characters.']}
          - <<: *image_field
            label: Welcome photo
            name: hero_image
          - <<: *image_alt_field
            label: Welcome photo description
            name: hero_image_alt
          - {label: Address, name: address, widget: text, pattern: ['^(?=\s*\S)[\s\S]{1,240}$', 'Enter the full address, up to 240 characters.']}
          - {label: Phone, name: phone, widget: string, pattern: ['^[+\d() .-]{7,40}$', 'Use a phone number, including the area code.']}
          - label: Online ordering URL
            name: order_url
            widget: string
            required: false
            pattern: ['^https://[^\s/@:]+(?::[0-9]+)?(?:[/?#][^\s]*)?$', 'Use a full https:// URL.']
            hint: "Link to your existing ordering service. Leave blank to hide Order online buttons. The starter's example.com link is only a placeholder."
          - label: Announcement
            name: announcement
            widget: string
            required: false
            pattern: ['^[\s\S]{0,180}$', 'Use up to 180 characters.']
            hint: "Optional banner at the top of the site. Clear this field to hide it."
          - label: Social links
            name: social_links
            widget: list
            required: false
            min: 0
            max: 5
            summary: "{{fields.label}}"
            fields:
              - {label: Platform name, name: label, widget: string, pattern: ['^(?=\s*\S)[\s\S]{1,40}$', 'Enter a name such as Instagram.']}
              - {label: Profile URL, name: url, widget: string, pattern: ['^https://[^\s/@:]+(?::[0-9]+)?(?:[/?#][^\s]*)?$', 'Use a full https:// URL.']}

  - name: hours
    label: Business hours
    files:
      - name: weekly
        label: Weekly hours
        file: content/hours.json
        fields:
          - label: Monday
            name: monday
            widget: object
            fields: &day_fields
              - {label: Closed all day, name: closed, widget: boolean, default: false}
              - label: Opens at
                name: open
                widget: string
                default: "07:00"
                pattern: ['^([01]\d|2[0-3]):[0-5]\d$', 'Use 24-hour time, such as 07:00 or 14:30.']
                hint: "Ignored when Closed all day is on. Keep a time here so you can reopen easily."
              - label: Closes at
                name: close
                widget: string
                default: "17:00"
                pattern: ['^([01]\d|2[0-3]):[0-5]\d$', 'Use 24-hour time, such as 17:00.']
                hint: "Ignored when closed. A closing time at or before opening means the next day."
          - {label: Tuesday, name: tuesday, widget: object, fields: *day_fields}
          - {label: Wednesday, name: wednesday, widget: object, fields: *day_fields}
          - {label: Thursday, name: thursday, widget: object, fields: *day_fields}
          - {label: Friday, name: friday, widget: object, fields: *day_fields}
          - {label: Saturday, name: saturday, widget: object, fields: *day_fields}
          - {label: Sunday, name: sunday, widget: object, fields: *day_fields}
