backend:
  name: github
  repo: dangpm/sveltia-demo
  branch: main
  base_url: https://sveltia.dang.pm
  auth_endpoint: auth

# Mở pull request thay vì commit thẳng? Bật editorial_workflow để thử duyệt bài.
# publish_mode: editorial_workflow

# Ảnh/video upload từ CMS → commit vào static/media trong repo.
# public_folder phải là path tương đối (Sveltia không nhận URL tuyệt đối).
# Trang landing tự ghép raw GitHub URL khi render (xem resolveMedia trong /site/).
media_folder: "static/media"
public_folder: "/static/media"

site_url: https://sveltia.dang.pm
display_url: https://sveltia.dang.pm
logo_url: https://sveltia.dang.pm/logo.svg

collections:
  - name: home
    label: "Trang chủ"
    description: "Nội dung landing tại /site/ — sửa chữ/CTA, layout thiết kế giữ nguyên."
    files:
      - label: "Landing — Hạt & Lửa"
        name: "home"
        file: "content/home.json"
        fields:
          - { label: "Tên thương hiệu", name: "brand", widget: "string" }
          - { label: "Eyebrow (dòng nhỏ trên tiêu đề)", name: "hero_eyebrow", widget: "string" }
          - { label: "Tiêu đề lớn", name: "hero_title", widget: "string" }
          - { label: "Mô tả hero", name: "hero_subtitle", widget: "text" }
          - { label: "Ảnh hero (upload hoặc dán URL)", name: "hero_image", widget: "image", required: false, hint: "Bấm để upload ảnh — Sveltia tự commit vào repo." }
          - { label: "Nút CTA — chữ", name: "hero_cta_label", widget: "string" }
          - { label: "Nút CTA — link", name: "hero_cta_url", widget: "string" }
          - { label: "Ghi chú nhỏ cạnh CTA", name: "hero_note", widget: "string", required: false }
          - label: "Tính năng (3 thẻ)"
            name: "features"
            widget: "list"
            label_singular: "Thẻ"
            summary: "{{fields.title}}"
            fields:
              - { label: "Icon (emoji)", name: "icon", widget: "string" }
              - { label: "Tiêu đề", name: "title", widget: "string" }
              - { label: "Mô tả", name: "desc", widget: "text" }
          - { label: "Video — tiêu đề", name: "video_title", widget: "string", required: false }
          - { label: "Video — link hoặc upload", name: "video_url", widget: "string", required: false, hint: "Dán link YouTube/Vimeo, hoặc URL .mp4. Muốn upload file: đổi sang widget file." }
          - { label: "Video — chú thích", name: "video_caption", widget: "text", required: false }
          - { label: "Footer", name: "footer_note", widget: "string", required: false }

  - name: jungle8
    label: "Jungle 8 (site thật)"
    description: "Nội dung site nhà hàng Jungle 8 tại /jungle8/ — sửa chữ/menu/giờ/địa chỉ, thiết kế giữ nguyên."
    files:
      - label: "Trang Jungle 8"
        name: "jungle8"
        file: "content/jungle8.json"
        fields:
          - label: "Hero"
            name: hero
            widget: object
            fields:
              - { label: "Video label (dòng đầu)", name: video_label_a, widget: string }
              - { label: "Video label (chữ xanh)", name: video_label_b, widget: string }
              - { label: "Tag", name: tag, widget: string }
              - { label: "Tiêu đề promo", name: title, widget: string }
              - { label: "Mô tả promo", name: text, widget: text }
          - label: "Giờ mở cửa"
            name: hours
            widget: object
            fields:
              - { label: "Dòng chính", name: primary, widget: string }
              - { label: "Dòng phụ", name: secondary, widget: string }
          - label: "About"
            name: about
            widget: object
            fields:
              - { label: "Tiêu đề", name: title, widget: string }
              - { label: "Đoạn 1", name: p1, widget: text }
              - { label: "Đoạn 2", name: p2, widget: text }
          - label: "Thực đơn"
            name: menu
            widget: list
            label_singular: "Món"
            summary: "{{fields.name}} — {{fields.price}}"
            fields:
              - { label: "Tên món", name: name, widget: string }
              - { label: "Chay (V)", name: veg, widget: boolean, default: false }
              - { label: "Mô tả", name: desc, widget: text }
              - { label: "Giá", name: price, widget: string }
          - label: "DJ"
            name: dj
            widget: object
            fields:
              - { label: "Kicker", name: kicker, widget: string }
              - { label: "Tiêu đề", name: title, widget: string }
              - { label: "Mô tả", name: text, widget: text }
          - label: "Địa điểm"
            name: location
            widget: object
            fields:
              - { label: "Địa chỉ", name: address, widget: text }
              - { label: "Giờ", name: hours, widget: text }
              - { label: "Email", name: email, widget: string }
              - { label: "Đỗ xe", name: parking, widget: text }
          - label: "Journal"
            name: journal
            widget: list
            label_singular: "Bài"
            summary: "{{fields.title}}"
            fields:
              - { label: "Chuyên mục", name: category, widget: string }
              - { label: "Tiêu đề", name: title, widget: string }
              - { label: "Tóm tắt", name: excerpt, widget: text }
          - label: "Footer"
            name: footer
            widget: object
            fields:
              - { label: "Giới thiệu ngắn", name: about, widget: text }
              - { label: "Hotline", name: hotline, widget: string }

  - name: blog
    label: "Bài viết"
    label_singular: "Bài viết"
    description: "Blog demo — tạo / sửa / xoá, mỗi thao tác là 1 commit vào GitHub."
    folder: "content/blog"
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    summary: "{{title}}  ·  {{date}}"
    sortable_fields: ["date", "title"]
    fields:
      - { label: "Tiêu đề", name: "title", widget: "string" }
      - { label: "Ngày đăng", name: "date", widget: "datetime" }
      - { label: "Ảnh bìa", name: "thumbnail", widget: "image", required: false }
      - { label: "Tóm tắt", name: "summary", widget: "text", required: false }
      - { label: "Tác giả", name: "author", widget: "string", default: "Dang", required: false }
      - { label: "Tags", name: "tags", widget: "list", required: false }
      - { label: "Nội dung", name: "body", widget: "markdown" }

  - name: pages
    label: "Trang"
    description: "Các trang tĩnh (singleton)."
    files:
      - label: "Giới thiệu"
        name: "about"
        file: "content/pages/about.md"
        fields:
          - { label: "Tiêu đề", name: "title", widget: "string" }
          - { label: "Nội dung", name: "body", widget: "markdown" }

  - name: settings
    label: "Cấu hình"
    description: "Thông tin chung của site."
    files:
      - label: "Thông tin site"
        name: "site"
        file: "content/settings/site.json"
        fields:
          - { label: "Tên site", name: "title", widget: "string" }
          - { label: "Mô tả", name: "description", widget: "text" }
          - { label: "Email liên hệ", name: "email", widget: "string", required: false }
          - { label: "Hiển thị banner", name: "show_banner", widget: "boolean", default: true }
