backend:
  name: git-gateway
  branch: main
  commit_messages:
    create: 'add comic: "{{slug}}"'
    update: 'update comic: "{{slug}}"'
    delete: 'remove comic: "{{slug}}"'
    uploadMedia: 'upload {{path}}'
    deleteMedia: 'delete {{path}}'

# To use the deployed Netlify Identity from localhost (recommended), leave
# local_backend off. The /admin GUI will prompt for your Netlify URL once
# and then auth against the live Identity instance.
#
# To work offline against local files instead, flip the next line to true and
# run `npx decap-server` in another terminal:
# local_backend: true

site_url: https://visionary-churros-886982.netlify.app
display_url: visionary-churros-886982.netlify.app

media_folder: 'public/uploads'
public_folder: '/uploads'

publish_mode: simple

collections:
  - name: comics
    label: Comics
    label_singular: Comic
    folder: 'src/content/comics'
    create: true
    slug: '{{year}}-{{month}}-{{day}}-{{slug}}'
    summary: '{{title}} — {{date | date("YYYY-MM-DD")}}'
    sortable_fields: ['date', 'title']
    view_filters:
      - label: Past month
        field: date
        pattern: '\d{4}-\d{2}'
    fields:
      - { label: Title, name: title, widget: string }
      - { label: Date, name: date, widget: datetime, date_format: 'YYYY-MM-DD', time_format: 'HH:mm', picker_utc: true, hint: 'time is used as a tiebreaker when two comics share the same day' }
      - { label: 'Comic image', name: image, widget: image }
      - { label: 'Alt text (for screen readers)', name: alt, widget: string, required: false, hint: 'Brief description of the image' }
      - { label: Caption, name: caption, widget: text, required: false, hint: 'Optional note shown under the comic' }

  - name: site
    label: Site
    label_singular: Site setting
    files:
      - name: site
        label: Site info
        file: 'src/content/site/site.json'
        fields:
          - { label: 'Site title', name: title, widget: string }
          - { label: Author, name: author, widget: string }
          - { label: Tagline, name: tagline, widget: string }
          - { label: 'About text', name: about, widget: text, required: false }
