backend:
  name: github
  repo: garyhawton/hwit_kb_method
  branch: main

# Lets you run the CMS against your local repo (npx decap-server) with no login.
local_backend: true

media_folder: "public/media/method/articles"
public_folder: "/media/method/articles"

# One flat collection. Unlike the Fundamentals site, articles are NOT filed in
# per-category folders: every article lives in src/content/docs/article/ so its
# URL keeps matching the tawk URL it inherited. Category membership is a field.
collections:
  - name: articles
    label: "Articles"
    label_singular: "Article"
    folder: "src/content/docs/article"
    create: true
    extension: md
    format: frontmatter
    sortable_fields: ["title", "sidebar.order"]
    # New articles get a slug from the title. NEVER rename an existing article:
    # the filename is the live URL, and renaming breaks inbound links from the
    # Method app and from email.
    slug: "{{slug}}"
    preview_path: "article/{{slug}}"
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Description", name: "description", widget: "text", required: false }
      - label: "Category"
        name: "category"
        widget: "object"
        required: false
        fields:
          - label: "Section"
            name: "slug"
            widget: "select"
            hint: "Where this article is filed in the sidebar and on the category pages"
            options:
              - { label: "HWIT Business Management", value: "hwit-business-management" }
              - { label: "HWIT Business Management / Estate Management", value: "estate-management" }
              - { label: "HWIT Business Management / Home Inventory", value: "home-inventory" }
              - { label: "HWIT Business Management / Home Watch Admin", value: "home-watch-admin" }
              - { label: "HWIT Business Management / Home Watch Admin / Creating & Sending Inspection Reports", value: "creating-sending-inspection-reports" }
              - { label: "HWIT Business Management / Home Watch Admin / Preferences", value: "preferences" }
              - { label: "HWIT Business Management / Home Watch Admin / Processing Incoming Emails", value: "processing-incoming-emails" }
              - { label: "HWIT Business Management / Home Watch Admin / Work Orders & Series / Scheduling", value: "work-orders-series-scheduling" }
              - { label: "HWIT Business Management / Home Watch Customers", value: "home-watch-customers" }
              - { label: "HWIT Business Management / Home Watch Customers / Contracts Management", value: "contracts-management" }
              - { label: "HWIT Business Management / Home Watch In Residence", value: "home-watch-in-residence" }
              - { label: "HWIT Business Management / Home Watch Invoicing", value: "home-watch-invoicing" }
              - { label: "HWIT Business Management / Home Watch Invoicing / Prepayments", value: "prepayments" }
              - { label: "HWIT Business Management / Home Watch Issues", value: "home-watch-issues" }
              - { label: "HWIT Business Management / Home Watch Planning", value: "home-watch-planning" }
              - { label: "HWIT Business Management / Home Watch Route Technician", value: "home-watch-route-technician" }
              - { label: "HWIT Business Management / RBO Management", value: "rbo-management" }
              - { label: "HWIT Business Management / Release Notes", value: "release-notes-24" }
              - { label: "HWIT Business Management / Vendor Management", value: "vendor-management" }
              - { label: "HWIT Business Mgmt Tutorials 101", value: "hwit-business-mgmt-tutorials-101" }
              - { label: "MonitorQA", value: "monitorqa" }
              - { label: "SafetyCulture", value: "safetyculture" }
              - { label: "Webinars & Other Info", value: "webinars-other-info" }
      - label: "Also in (extra sections)"
        name: "alsoIn"
        widget: "select"
        multiple: true
        required: false
        hint: "Cross-list this article under these sections too"
        options:
          - { label: "HWIT Business Management", value: "hwit-business-management" }
          - { label: "HWIT Business Management / Estate Management", value: "estate-management" }
          - { label: "HWIT Business Management / Home Inventory", value: "home-inventory" }
          - { label: "HWIT Business Management / Home Watch Admin", value: "home-watch-admin" }
          - { label: "HWIT Business Management / Home Watch Admin / Creating & Sending Inspection Reports", value: "creating-sending-inspection-reports" }
          - { label: "HWIT Business Management / Home Watch Admin / Preferences", value: "preferences" }
          - { label: "HWIT Business Management / Home Watch Admin / Processing Incoming Emails", value: "processing-incoming-emails" }
          - { label: "HWIT Business Management / Home Watch Admin / Work Orders & Series / Scheduling", value: "work-orders-series-scheduling" }
          - { label: "HWIT Business Management / Home Watch Customers", value: "home-watch-customers" }
          - { label: "HWIT Business Management / Home Watch Customers / Contracts Management", value: "contracts-management" }
          - { label: "HWIT Business Management / Home Watch In Residence", value: "home-watch-in-residence" }
          - { label: "HWIT Business Management / Home Watch Invoicing", value: "home-watch-invoicing" }
          - { label: "HWIT Business Management / Home Watch Invoicing / Prepayments", value: "prepayments" }
          - { label: "HWIT Business Management / Home Watch Issues", value: "home-watch-issues" }
          - { label: "HWIT Business Management / Home Watch Planning", value: "home-watch-planning" }
          - { label: "HWIT Business Management / Home Watch Route Technician", value: "home-watch-route-technician" }
          - { label: "HWIT Business Management / RBO Management", value: "rbo-management" }
          - { label: "HWIT Business Management / Release Notes", value: "release-notes-24" }
          - { label: "HWIT Business Management / Vendor Management", value: "vendor-management" }
          - { label: "HWIT Business Mgmt Tutorials 101", value: "hwit-business-mgmt-tutorials-101" }
          - { label: "MonitorQA", value: "monitorqa" }
          - { label: "SafetyCulture", value: "safetyculture" }
          - { label: "Webinars & Other Info", value: "webinars-other-info" }
      - label: "Sidebar"
        name: "sidebar"
        widget: "object"
        required: false
        fields:
          - {
              label: "Order",
              name: "order",
              widget: "number",
              value_type: "int",
              min: 0,
              required: false,
              hint: "Lower number appears higher in the sidebar",
            }
      - {
          label: "Status",
          name: "status",
          widget: "select",
          options: ["published", "draft", "archived"],
          default: "published",
        }
      - { label: "Product site", name: "productSite", widget: "hidden", default: "method-crm" }
      - {
          label: "Last reviewed",
          name: "lastReviewed",
          widget: "datetime",
          date_format: "YYYY-MM-DD",
          time_format: false,
          required: false,
        }
      - { label: "Tags", name: "tags", widget: "list", required: false }
      - label: "Source (migration traceability)"
        name: "source"
        widget: "object"
        required: false
        collapsed: true
        fields:
          - { label: "System", name: "system", widget: "string", required: false }
          - { label: "URL", name: "url", widget: "string", required: false }
          - { label: "Updated at", name: "updatedAt", widget: "string", required: false }
      - label: "AI hints (optional)"
        name: "ai"
        widget: "object"
        required: false
        collapsed: true
        fields:
          - { label: "Aliases", name: "aliases", widget: "list", required: false }
          - { label: "Common questions", name: "commonQuestions", widget: "list", required: false }
          - { label: "Answer summary", name: "answerSummary", widget: "text", required: false }
          - { label: "Ask when ambiguous", name: "shouldAskWhen", widget: "list", required: false }
      - {
          label: "Body",
          name: "body",
          widget: "markdown",
          hint: "Add a video with ::video{provider=\"vimeo\" videoId=\"123\" privacyHash=\"abc\" title=\"...\"} on its own line. YouTube: provider=\"youtube\" videoId=\"abc123\".",
        }
