backend:
  name: github
  repo: ipritamsingh/monetizegyan
  branch: main
  skip_ci: true

local_backend: true

# Media uploaded via the CMS is stored in the repo (GitHub).
media_folder: "public/assets/uploads"
public_folder: "/assets/uploads"

# Internal media library: auto-convert uploads to optimized WebP,
# cap file size at 5 MB, slugify filenames.
media_libraries:
  default:
    config:
      max_file_size: 5120000
      slugify_filename: true
      transformations:
        raster_image:
          format: webp
          quality: 85
          width: 2048
          height: 2048
        svg:
          optimize: true

collections:
  # ═══════════════════════════════════════════════════════
  # TUTORIAL POSTS
  # ═══════════════════════════════════════════════════════
  - name: "posts"
    label: "Tutorial Posts"
    folder: "src/content/posts"
    create: true
    slug: "{{slug}}"
    format: "frontmatter"
    extension: "md"
    sortable_fields: [publishedDate, title]
    preview_path: "/{{slug}}"
    editor:
      preview: true
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Description", name: "description", widget: "text" }
      - { label: "Publish Date", name: "publishedDate", widget: "datetime" }
      - { label: "Updated Date", name: "updatedDate", widget: "datetime", required: false }
      - { label: "Author", name: "author", widget: "string", default: "Monetize Gyan" }
      - label: "Category"
        name: "category"
        widget: "relation"
        collection: "categories"
        value_field: "{{slug}}"
        search_fields: [name]
      - { label: "Tags", name: "tags", widget: "list", default: [] }
      - { label: "Featured Image", name: "featuredImage", widget: "image", required: false }
      - { label: "Image Alt Text", name: "featuredImageAlt", widget: "string", required: false }
      - { label: "YouTube Video ID / URL", name: "youtubeUrl", widget: "string", required: false, hint: "Full YouTube URL or video ID" }
      - label: "Resources"
        name: "resources"
        widget: "list"
        required: false
        summary: "{{fields.title}}"
        fields:
          - { label: "Type", name: "type", widget: "select", options: ["prompt", "link", "download", "image", "code"] }
          - { label: "Title", name: "title", widget: "string" }
          - { label: "File or URL", name: "url", widget: "file", required: false, hint: "Upload a file or paste a URL" }
          - { label: "Prompt Text", name: "prompt", widget: "text", required: false }
          - { label: "Description", name: "description", widget: "text", required: false }
          - { label: "File Size", name: "fileSize", widget: "string", required: false, hint: "e.g., 2.5MB" }
          - { label: "File Type", name: "fileType", widget: "string", required: false, hint: "e.g., PDF, ZIP" }
          - { label: "AI Tool", name: "aiTool", widget: "string", required: false, hint: "e.g., ChatGPT, Midjourney" }
      - { label: "Body Content", name: "body", widget: "markdown", hint: "Use the Insert button to add Download boxes, Buttons, Tables, Galleries, Callouts, YouTube embeds and more anywhere in the article." }
      - { label: "SEO Title", name: "seoTitle", widget: "string", required: false }
      - { label: "SEO Description", name: "seoDescription", widget: "text", required: false }
      - { label: "Canonical URL", name: "canonicalUrl", widget: "string", required: false }
      - { label: "Draft", name: "draft", widget: "boolean", default: false }
      - { label: "No Index", name: "noindex", widget: "boolean", default: false }
      - { label: "Reading Time", name: "readingTime", widget: "string", required: false }
      - { label: "Excerpt", name: "excerpt", widget: "text", required: false }
      - { label: "Related Posts", name: "relatedPosts", widget: "list", required: false }
      - { label: "Table of Contents", name: "toc", widget: "boolean", default: true }
      - label: "FAQs"
        name: "faq"
        widget: "list"
        required: false
        summary: "{{fields.question}}"
        hint: "Add questions readers ask — shown as an accordion and auto-generates FAQ schema"
        fields:
          - { label: "Question", name: "question", widget: "string" }
          - { label: "Answer", name: "answer", widget: "text" }

  # ═══════════════════════════════════════════════════════
  # CATEGORIES
  # ═══════════════════════════════════════════════════════
  - name: "categories"
    label: "Categories"
    folder: "src/content/categories"
    create: true
    slug: "{{slug}}"
    format: "frontmatter"
    extension: "md"
    sortable_fields: [order, name]
    fields:
      - { label: "Name", name: "name", widget: "string" }
      - { label: "Slug", name: "slug", widget: "string" }
      - { label: "Description", name: "description", widget: "text" }
      - { label: "Image", name: "image", widget: "image", required: false }
      - { label: "Color Theme", name: "color", widget: "select", options: ["green", "purple", "orange", "blue", "pink", "teal"] }
      - { label: "SEO Title", name: "seoTitle", widget: "string", required: false }
      - { label: "SEO Description", name: "seoDescription", widget: "text", required: false }
      - { label: "Order", name: "order", widget: "number", default: 0 }

  # ═══════════════════════════════════════════════════════
  # AUTHORS
  # ═══════════════════════════════════════════════════════
  - name: "authors"
    label: "Authors"
    folder: "src/content/authors"
    create: true
    slug: "{{slug}}"
    format: "frontmatter"
    extension: "md"
    fields:
      - { label: "Show author on posts", name: "enabled", widget: "boolean", default: true }
      - { label: "Name", name: "name", widget: "string" }
      - { label: "Slug", name: "slug", widget: "string" }
      - { label: "Bio", name: "bio", widget: "text" }
      - { label: "Avatar", name: "avatar", widget: "image", required: false }
      - { label: "Website", name: "website", widget: "string", required: false }
      - label: "Social Links"
        name: "socialLinks"
        widget: "list"
        required: false
        summary: "{{fields.label}}"
        hint: "Add as many social links as you need - they appear on the About page profile"
        fields:
          - { label: "Label", name: "label", widget: "string", required: true, hint: "e.g. YouTube, Instagram, LinkedIn" }
          - label: "Platform (icon)"
            name: "platform"
            widget: "select"
            default: "youtube"
            options: ["youtube", "telegram", "whatsapp", "instagram", "facebook", "twitter", "github", "linkedin", "rss", "website"]
            hint: "The brand icon shown on the button"
          - { label: "URL", name: "url", widget: "string", required: true }

  # ═══════════════════════════════════════════════════════
  # PAGES (About, Contact, Privacy, ...)
  # ═══════════════════════════════════════════════════════
  - name: "pages"
    label: "Pages"
    label_singular: "Page"
    folder: "src/content/pages"
    create: true
    slug: "{{slug}}"
    format: "frontmatter"
    extension: "md"
    sortable_fields: [title]
    editor:
      preview: true
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Description", name: "description", widget: "text", required: false, hint: "One or two sentences shown under the title and in search results." }
      - { label: "Updated date", name: "updatedDate", widget: "datetime", required: false, format: "YYYY-MM-DD", date_format: "YYYY-MM-DD", time_format: false }
      - { label: "Featured image", name: "featuredImage", widget: "image", required: false }
      - { label: "SEO title", name: "seoTitle", widget: "string", required: false, hint: "Optional - falls back to the title." }
      - { label: "SEO description", name: "seoDescription", widget: "text", required: false }
      - { label: "Draft", name: "draft", widget: "boolean", default: false }
      - { label: "Exclude from search engines", name: "noindex", widget: "boolean", default: false }
      - { label: "Page body", name: "body", widget: "markdown", hint: "Use the Insert button to add Download boxes, Buttons, Tables, Galleries, Callouts, YouTube embeds and more." }

  # ═══════════════════════════════════════════════════════
  # SITE FILES (managed site-wide settings)
  # ═══════════════════════════════════════════════════════
  - name: "settings"
    label: "Site Files"
    editor:
      preview: false
    files:
      # ── Site identity & SEO defaults ──
      # Site name, title and description drive the homepage title tag,
      # meta/OG tags and the homepage JSON-LD schemas automatically.
      - name: "site"
        label: "Site Identity & SEO"
        file: "src/data/site.json"
        fields:
          - { label: "Site name", name: "siteName", widget: "string", required: true, hint: "Used in titles, og:site_name and Organization/WebSite schemas" }
          - { label: "Tagline", name: "tagline", widget: "text", required: false }
          - { label: "Homepage SEO title", name: "seoTitle", widget: "string", required: true, hint: "The homepage <title> tag" }
          - { label: "Homepage SEO description", name: "seoDescription", widget: "text", required: true, hint: "The homepage meta description" }
          - { label: "Logo / OG image", name: "logo", widget: "image", required: false, hint: "Default social share image + Organization logo" }

      # ── Header & footer links ──
      - name: "navigation"
        label: "Header & Footer Links"
        file: "src/data/navigation.json"
        fields:
          - label: "Header brand (logo)"
            name: "headerBrand"
            widget: "object"
            fields:
              - { label: "Logo image", name: "logo", widget: "image", required: false, hint: "Square logo works best - shown at 36px in the header" }
              - { label: "Brand name", name: "name", widget: "string", required: true }
          - label: "Header links"
            name: "header"
            label_singular: "Link"
            widget: "list"
            required: false
            summary: "{{fields.label}}"
            fields:
              - { label: "Label", name: "label", widget: "string", required: true }
              - { label: "URL", name: "href", widget: "string", required: true, hint: "Site path like /posts or full https:// URL (opens in a new tab)" }
          - label: "Subscribe button"
            name: "subscribe"
            widget: "object"
            fields:
              - { label: "Button label (desktop)", name: "label", widget: "string", required: true }
              - { label: "Button label (mobile)", name: "mobileLabel", widget: "string", required: false, hint: "Falls back to the desktop label when empty" }
              - { label: "Button URL", name: "href", widget: "string", required: true, hint: "Site path or full https:// URL (opens in a new tab)" }
          - label: "Footer columns"
            name: "footerColumns"
            label_singular: "Column"
            widget: "list"
            required: false
            summary: "{{fields.heading}}"
            fields:
              - { label: "Column heading", name: "heading", widget: "string", required: true }
              - label: "Links"
                name: "links"
                label_singular: "Link"
                widget: "list"
                required: false
                summary: "{{fields.label}}"
                fields:
                  - { label: "Label", name: "label", widget: "string", required: true }
                  - { label: "URL", name: "href", widget: "string", required: true }
          - label: "Social icons (footer brand column)"
            name: "socialLinks"
            label_singular: "Social link"
            widget: "list"
            required: false
            summary: "{{fields.label}}"
            fields:
              - { label: "Label", name: "label", widget: "string", required: true }
              - { label: "Platform (icon)", name: "platform", widget: "select", options: ["youtube", "telegram", "whatsapp", "instagram", "facebook", "twitter", "github", "rss"], hint: "The brand icon shown on the button" }
              - { label: "URL", name: "href", widget: "string", required: true }
          - label: "Footer brand (logo + tagline)"
            name: "footerBrand"
            widget: "object"
            fields:
              - { label: "Logo image", name: "logo", widget: "image", required: false }
              - { label: "Brand name", name: "name", widget: "string", required: true }
              - { label: "Tagline", name: "tagline", widget: "text", required: false, hint: "Short description under the logo - leave empty to hide it" }
          - { label: "Copyright line", name: "copyright", widget: "string", required: false, hint: "Use {year} for the auto-updating year" }
          - { label: "Credit line", name: "creditLine", widget: "string", required: false, hint: "Small text on the bottom-right of the footer" }

      # ── Top promo banner ──
      - name: "promo"
        label: "Top Promo Banner"
        file: "src/data/promo.json"
        fields:
          - { label: "Show banner", name: "enabled", widget: "boolean", default: true, hint: "Turn the top promo banner on or off" }
          - { label: "Offer badge", name: "badge", widget: "string", required: false, hint: "e.g. New course, 50% off, Free PDF" }
          - { label: "Message", name: "message", widget: "text", required: true, hint: "The banner text promoting your course, PDF or product" }
          - { label: "Link label", name: "linkLabel", widget: "string", required: false, hint: "e.g. Enroll now" }
          - { label: "Link URL", name: "linkUrl", widget: "string", required: false, hint: "Where the link points - full URL or site path like /posts" }

      # ── Homepage hero ──
      - name: "hero"
        label: "Homepage Hero"
        file: "src/data/hero.json"
        fields:
          - { label: "Eyebrow badge", name: "eyebrow", widget: "string", required: false, hint: "Small pill above the headline - leave empty to hide it" }
          - { label: "Headline", name: "title", widget: "string", required: true }
          - { label: "Highlighted word", name: "titleHighlight", widget: "string", required: false, hint: "The word shown in gradient color at the end of the headline" }
          - { label: "Subtitle", name: "subtitle", widget: "text", required: true }
          - label: "Primary button"
            name: "primaryButton"
            widget: "object"
            fields:
              - { label: "Button label", name: "label", widget: "string", required: true }
              - { label: "Button URL", name: "href", widget: "string", required: true, hint: "Site path like /posts or full https:// URL" }
          - label: "Secondary button"
            name: "secondaryButton"
            widget: "object"
            fields:
              - { label: "Button label", name: "label", widget: "string", required: true }
              - { label: "Button URL", name: "href", widget: "string", required: true }
              - { label: "Opens in new tab", name: "external", widget: "boolean", default: false }

      # ── Community CTA ──
      - name: "community"
        label: "Community CTA"
        file: "src/data/community.json"
        fields:
          - { label: "Heading", name: "heading", widget: "string", required: true, hint: "Main headline above the buttons" }
          - { label: "Description", name: "description", widget: "text", required: false, hint: "Supporting text under the heading - leave empty to hide it" }
          - label: "Buttons"
            name: "buttons"
            label_singular: "Button"
            widget: "list"
            required: false
            summary: "{{fields.label}}"
            fields:
              - { label: "Button label", name: "label", widget: "string", required: true }
              - { label: "Button URL", name: "url", widget: "string", required: true, hint: "Full https:// URL (opens in a new tab)" }
              - { label: "Style", name: "style", widget: "select", default: "primary", options: ["primary", "secondary"], hint: "Primary = green pill, secondary = outline pill" }
              - { label: "Icon", name: "icon", widget: "select", default: "telegram", options: ["telegram", "whatsapp", "youtube", "instagram", "facebook", "twitter", "github"], hint: "Brand icon shown on the button" }

      # ── Share buttons ──
      - name: "share"
        label: "Share Buttons"
        file: "src/data/share.json"
        fields:
          - { label: "Facebook icon", name: "facebook", widget: "boolean", default: true }
          - { label: "Twitter / X icon", name: "twitter", widget: "boolean", default: true }
          - { label: "Telegram icon", name: "telegram", widget: "boolean", default: true }
          - { label: "WhatsApp icon", name: "whatsapp", widget: "boolean", default: true }
          - { label: "Copy link button", name: "copyLink", widget: "boolean", default: true }

      # ── Author profile ──
      # Edits the same file as Authors → Monetize Gyan (single source of truth).
      - name: "author"
        label: "Author Profile"
        file: "src/content/authors/monetize-gyan.md"
        format: "frontmatter"
        fields:
          - { label: "Show author on posts", name: "enabled", widget: "boolean", default: true }
          - { label: "Author name", name: "name", widget: "string", required: true, hint: "Shown next to the published date on every tutorial" }
          - { label: "Bio", name: "bio", widget: "text", required: false }
          - { label: "Profile icon", name: "avatar", widget: "image", required: false, hint: "Square photo works best - shown as a circle next to the name" }
          - { label: "Website", name: "website", widget: "string", required: false }
          - label: "Social Links"
            name: "socialLinks"
            widget: "list"
            required: false
            summary: "{{fields.label}}"
            fields:
              - { label: "Label", name: "label", widget: "string", required: true }
              - { label: "Platform (icon)", name: "platform", widget: "select", options: ["youtube", "telegram", "whatsapp", "instagram", "facebook", "twitter", "github", "linkedin", "rss", "website"] }
              - { label: "URL", name: "url", widget: "string", required: true }

      # ── AdSense ads ──
      - name: "ads"
        label: "AdSense Ads"
        file: "src/data/ads.json"
        fields:
          - label: "Header ad - below header on every page"
            name: "header"
            widget: "object"
            fields:
              - { label: "Show this ad", name: "enabled", widget: "boolean", default: false }
              - { label: "Ad code", name: "code", widget: "text", required: false, hint: "Paste the AdSense ad unit code here." }
          - label: "Post top ad - below the post header"
            name: "postTop"
            widget: "object"
            fields:
              - { label: "Show this ad", name: "enabled", widget: "boolean", default: false }
              - { label: "Ad code", name: "code", widget: "text", required: false }
          - label: "Post bottom ad - end of article"
            name: "postBottom"
            widget: "object"
            fields:
              - { label: "Show this ad", name: "enabled", widget: "boolean", default: false }
              - { label: "Ad code", name: "code", widget: "text", required: false }
          - label: "Post middle ad - inside the article"
            name: "postMiddle"
            widget: "object"
            fields:
              - { label: "Show this ad", name: "enabled", widget: "boolean", default: false }
              - { label: "Ad code", name: "code", widget: "text", required: false, hint: "Inserted mid-article. Script tags run normally." }
              - { label: "Before which H2", name: "afterHeading", widget: "number", default: 2, hint: "Insert the ad immediately before this H2 heading (default 2). Articles with fewer H2s skip the ad." }
              - { label: "Show on tutorials", name: "showOnTutorials", widget: "boolean", default: true }
              - { label: "Show on pages", name: "showOnPages", widget: "boolean", default: false }
          - label: "Sidebar ad - below sidebar promo card"
            name: "sidebar"
            widget: "object"
            fields:
              - { label: "Show this ad", name: "enabled", widget: "boolean", default: false }
              - { label: "Ad code", name: "code", widget: "text", required: false, hint: "The sidebar is 300px wide - use a responsive or square unit." }
          - label: "Homepage ad - below tutorials grid"
            name: "homepage"
            widget: "object"
            fields:
              - { label: "Show this ad", name: "enabled", widget: "boolean", default: false }
              - { label: "Ad code", name: "code", widget: "text", required: false, hint: "Appears on the homepage between the tutorials grid and the Community CTA." }
          - label: "Footer ad - above footer on every page"
            name: "footer"
            widget: "object"
            fields:
              - { label: "Show this ad", name: "enabled", widget: "boolean", default: false }
              - { label: "Ad code", name: "code", widget: "text", required: false }

      # ── Custom code ──
      - name: "custom-code"
        label: "Custom Code (Head & Body)"
        file: "src/data/custom-code.json"
        fields:
          - { label: "Code inside <head>", name: "headCode", widget: "text", required: false, hint: "Paste here: Google Search Console verification meta tag, Bing verification meta tag, fonts, or any <head> scripts. Leave empty to inject nothing." }
          - { label: "Code before </body>", name: "bodyCode", widget: "text", required: false, hint: "Paste here: analytics snippets, chat widgets, or any library scripts that must load at the end of the page. Leave empty to inject nothing." }

      # ── SEO & robots ──
      - name: "seo"
        label: "SEO & Robots"
        file: "src/data/seo.json"
        fields:
          - { label: "Hide entire site from search engines", name: "siteNoindex", widget: "boolean", default: false, hint: "ON adds noindex to every page. Overrides all per-post settings. Use only when the site must stay private." }
          - label: "Robots.txt mode"
            name: "robotsMode"
            widget: "select"
            default: "allow"
            options: ["allow", "disallowAll", "custom"]
            hint: "allow = normal (sitemap advertised); disallowAll = block all crawlers; custom = use the text below verbatim"
          - label: "Custom robots.txt body"
            name: "robotsCustom"
            widget: "text"
            required: false
            hint: "Only used when mode is set to custom. Keep 'Disallow: /admin/' so the CMS login page stays out of Google."

      # ── Site theme ──
      - name: "theme"
        label: "Site Theme (Colors)"
        file: "src/data/theme.json"
        fields:
          - label: "Brand colors"
            name: "colors"
            widget: "object"
            fields:
              - { label: "Brand green (primary accent)", name: "brandGreen", widget: "color", allowInput: true, default: "#00ed64" }
              - { label: "Brand green dark (buttons)", name: "brandGreenDark", widget: "color", allowInput: true, default: "#00684a" }
              - { label: "Brand green mid", name: "brandGreenMid", widget: "color", allowInput: true, default: "#00a35c" }
              - { label: "Brand green soft (light bg)", name: "brandGreenSoft", widget: "color", allowInput: true, default: "#c3f0d2" }
              - { label: "Brand teal deep (dark bg)", name: "brandTealDeep", widget: "color", allowInput: true, default: "#001e2b" }
              - { label: "Brand teal", name: "brandTeal", widget: "color", allowInput: true, default: "#003d4f" }
              - { label: "Accent purple (category)", name: "accentPurple", widget: "color", allowInput: true, default: "#7b3ff2" }
              - { label: "Accent orange (category)", name: "accentOrange", widget: "color", allowInput: true, default: "#fa6e39" }
              - { label: "Accent pink (category)", name: "accentPink", widget: "color", allowInput: true, default: "#f06bb8" }
              - { label: "Accent blue (category)", name: "accentBlue", widget: "color", allowInput: true, default: "#3d4f9f" }

      # ── AI tools marquee ──
      - name: "ai-tools"
        label: "AI Tools Marquee"
        file: "src/data/ai-tools.json"
        fields:
          - { label: "Show marquee", name: "enabled", widget: "boolean", default: false, hint: "Scrolling AI tool logos above the tutorials grid on the homepage" }
          - { label: "Section heading", name: "heading", widget: "string", required: false, hint: "Line above the scrolling logos" }
          - label: "Logos"
            name: "logos"
            label_singular: "Logo"
            widget: "list"
            required: false
            summary: "{{fields.name}}"
            fields:
              - { label: "Tool name", name: "name", widget: "string", required: true }
              - { label: "Logo image", name: "logo", widget: "image", required: true, hint: "Square logos work best - SVG stays SVG, raster images auto-convert to WebP" }

      # ── Sidebar promo card ──
      - name: "sidebar-promo"
        label: "Sidebar Promo Card"
        file: "src/data/sidebar-promo.json"
        fields:
          - { label: "Show card", name: "enabled", widget: "boolean", default: false, hint: "Turn the post sidebar promo card on or off" }
          - { label: "Availability badge", name: "badge", widget: "string", required: false, hint: "Pill above the heading - leave empty to hide it" }
          - { label: "Heading", name: "heading", widget: "string", required: true, hint: "Main card headline" }
          - { label: "Description", name: "description", widget: "text", required: true, hint: "Short pitch paragraph under the heading" }
          - label: "Checklist"
            name: "checklist"
            label_singular: "Item"
            widget: "list"
            required: false
            summary: "{{fields.point}}"
            field: { label: "Point", name: "point", widget: "string" }
          - { label: "Button label", name: "buttonLabel", widget: "string", required: false, hint: "Leave empty to hide the button" }
          - { label: "Button URL", name: "buttonUrl", widget: "string", required: false, hint: "Full URL" }
