backend:
  name: github
  repo: varunvashisht1/Blog
  branch: main
  # No `base_url` here: this standalone repo doesn't depend on the
  # shared cms-oauth-proxy that the monorepo's network uses. Sveltia
  # falls back to PKCE (its hosted proxy at oauth.sveltia.dev) or PAT
  # — pick whichever in the sign-in dialog. Trade: one less piece of
  # network infrastructure to keep alive for this site.

# When running on localhost, Decap will look for the proxy server at
# http://localhost:8081 (started with `npx decap-server`) and write
# changes directly to your local files instead of committing to GitHub.
local_backend: true

# CMS branding — Sveltia respects these for the login + header chrome.
# The MutationObserver in index.html re-asserts the title + favicon every
# render in case the bundle clobbers them on boot.
site_url: https://varunvashisht.com/blog/
display_url: https://varunvashisht.com/blog/
logo_url: https://varunvashisht.com/favicon.svg

# Hero images + future inline media land here.
media_folder: public/media/uploads
public_folder: /blog/media/uploads

collections:
  # ──────────────────────────────────────────────────────────────────
  # SITE SETTINGS — masthead chrome + theme + community panel content.
  # Single JSON file; Decap / Sveltia render it as a single edit form.
  # ──────────────────────────────────────────────────────────────────
  - name: settings
    label: "⚙ Site Settings"
    files:
      - name: site
        label: "Blog settings"
        file: src/content/settings/site.json
        description: "Masthead chrome and the Salon content. Changes here ship on next build. The visual theme is fixed (Broadsheet Darkroom)."
        fields:
          - { label: "Title", name: title, widget: string, default: "Insights" }
          - { label: "Tagline (under the wordmark)", name: tagline, widget: text, default: "A field journal on PMO, enterprise transformation, and embedding generative AI into delivery — by Varun Vashisht." }
          - { label: "Volume label", name: volume, widget: string, default: "Volume I" }
          - { label: "Established year", name: establishedYear, widget: string, default: "2025" }
          - { label: "Location label", name: location, widget: string, default: "Faridabad / Remote" }
          - { label: "Show ticker", name: showTicker, widget: boolean, default: true, hint: "The kinetic news-ticker strip under the masthead." }
          - { label: "Show Reader Pulse panel", name: showReaderPulse, widget: boolean, default: true, hint: "Live reader-activity feed + saved quote, under the cover story." }
          - { label: "Show Salon section", name: showSalon, widget: boolean, default: true, hint: "Community section with the open prompts." }
          - label: "Salon prompts"
            name: salonPrompts
            widget: list
            hint: "Open prompts shown in The Salon. Edit, add, or reorder freely. Empty list hides the panel."
            fields:
              - { label: "Prompt", name: prompt, widget: text }
              - { label: "Replies (count)", name: replies, widget: number, value_type: int, default: 0 }
              - { label: "Readers in (count)", name: readers, widget: number, value_type: int, default: 0 }
              - { label: "Closes", name: closes, widget: string, default: "Friday" }
          - label: "Salon letters (developed prints)"
            name: salonLetters
            widget: list
            required: false
            hint: "Published reader letters pinned on the Salon board. Empty list hides the board."
            fields:
              - { label: "Excerpt", name: excerpt, widget: text }
              - { label: "Reader initials / byline", name: initials, widget: string, default: "A reader" }
              - { label: "Dispatch number (optional)", name: issue, widget: number, value_type: int, required: false }

      # ──────────────────────────────────────────────────────────────
      # Homepage editorial — every section label, h2 + sub, card copy,
      # ticker phrases, CTA labels. Section toggles + visibility live
      # in site.json above; the actual editorial strings live here.
      # ──────────────────────────────────────────────────────────────
      - name: homepage
        label: "📄 Homepage editorial"
        file: src/content/settings/homepage.json
        description: "Every label / headline / sub paragraph on /blog/ home. Token substitution: {count} = post count, {readers} = reader count, {issue} = issue number, {mins} = read time, {base} = '/blog'."
        fields:
          - { label: "Page title suffix (after settings.title)", name: page_title_suffix, widget: string }
          - { label: "Reader count (placeholder until telemetry lands)", name: reader_count, widget: number, value_type: int, default: 412 }
          - label: "🎙️ Hero / cover story"
            name: hero
            widget: object
            fields:
              - { label: "Live badge template ({readers})", name: live_template, widget: string }
              - { label: "Author meta label (e.g. 'BY')", name: by_label, widget: string }
              - { label: "Read-time meta label", name: read_time_label, widget: string }
              - { label: "Series meta label", name: series_label, widget: string }
              - { label: "Issues count template ({count})", name: issues_template, widget: string }
              - { label: "Primary CTA label", name: cta_primary, widget: string }
              - { label: "Browse-all CTA label", name: cta_browse, widget: string }
              - { label: "RSS CTA label", name: cta_rss, widget: string }
              - label: "Quote-of-the-issue card"
                name: quote_card
                widget: object
                fields:
                  - { label: "Topic eyebrow", name: topic, widget: string }
                  - { label: "Footer meta template ({issue} + {readers})", name: footer_meta_template, widget: text }
                  - { label: "Footer stamp", name: footer_stamp, widget: string }
              - label: "Reader-pulse card"
                name: pulse_card
                widget: object
                fields:
                  - { label: "Topic eyebrow", name: topic, widget: string }
                  - { label: "Headline template ({readers})", name: headline_template, widget: string }
                  - { label: "Lead template ('Most-read this hour:')", name: lead_template, widget: string }
                  - { label: "Most-saved label", name: saved_label, widget: string }
                  - { label: "Footer stamp", name: footer_stamp, widget: string }
              - label: "Next-issue card"
                name: next_card
                widget: object
                fields:
                  - { label: "Topic eyebrow", name: topic, widget: string }
                  - { label: "Fallback headline", name: fallback_headline, widget: string }
                  - { label: "Fallback body", name: fallback_body, widget: text }
                  - { label: "Footer template ({mins})", name: footer_template, widget: string }
          - label: "🎫 Ticker strip"
            name: ticker
            widget: object
            fields:
              - { label: "'Live in the journal' chip", name: live_chip, widget: string }
              - { label: "Issues label", name: issues_label, widget: string }
              - { label: "Issues suffix ('published')", name: issues_suffix, widget: string }
              - { label: "Salon segment template ({readers})", name: salon_template, widget: string }
              - { label: "Letters segment template ({queue})", name: letters_template, widget: string }
              - { label: "Letters queue count (placeholder)", name: letters_queue_count, widget: number, value_type: int, default: 7 }
              - { label: "Issue prefix", name: issue_label, widget: string }
              - { label: "Min-read suffix", name: min_read_suffix, widget: string }
          - label: "📰 Feed (this fortnight's reading)"
            name: feed
            widget: object
            fields:
              - { label: "Section label", name: section_label, widget: string }
              - { label: "Section h2", name: section_h, widget: string }
              - { label: "Section h2 em (italic)", name: section_h_em, widget: string }
              - { label: "View-all link template ({count})", name: view_all_template, widget: string }
              - label: "WIP card (shown when post count < 8)"
                name: wip_card
                widget: object
                fields:
                  - { label: "Topic prefix ('In draft · Issue')", name: topic_prefix, widget: string }
                  - { label: "Title", name: title, widget: string }
                  - { label: "Body", name: body, widget: text }
                  - { label: "Footer", name: footer, widget: string }
                  - { label: "Corner stamp", name: stamp, widget: string }
          - label: "💬 Salon"
            name: salon
            widget: object
            fields:
              - { label: "Section label", name: section_label, widget: string }
              - { label: "Section h2", name: section_h, widget: string }
              - { label: "Section h2 em", name: section_h_em, widget: string }
              - { label: "Send-letter link label", name: send_letter_label, widget: string }
              - { label: "Send-letter mailto subject", name: send_letter_mailto_subject, widget: string }
              - { label: "Open prompts card title", name: open_prompts_title, widget: string }
              - { label: "Live count template ({count})", name: live_label_template, widget: string }
              - { label: "Numbers card title", name: numbers_title, widget: string }
              - { label: "Reading-now template ({readers})", name: reading_now_template, widget: string }
              - { label: "Stat: issues label", name: stat_issues_label, widget: string }
              - { label: "Stat: threads label", name: stat_threads_label, widget: string }
              - { label: "Stat: volume label", name: stat_volume_label, widget: string }
              - { label: "Stat: tracking label", name: stat_tracking_label, widget: string }
              - { label: "Stat: tracking value", name: stat_tracking_value, widget: string }
              - { label: "Subscribe-by-email title", name: subscribe_email_title, widget: string }
              - { label: "Subscribe-by-email meta", name: subscribe_email_meta, widget: string }
          - label: "🧵 Recurring threads"
            name: threads
            widget: object
            fields:
              - { label: "Section label", name: section_label, widget: string }
              - { label: "Section h2", name: section_h, widget: string }
              - { label: "Section h2 em", name: section_h_em, widget: string }
          - label: "📚 Archive"
            name: archive
            widget: object
            fields:
              - { label: "Section label", name: section_label, widget: string }
              - { label: "Section h2", name: section_h, widget: string }
              - { label: "Section h2 em", name: section_h_em, widget: string }
              - { label: "Count singular", name: count_singular, widget: string }
              - { label: "Count plural", name: count_plural, widget: string }
          - label: "📨 Newsletter / stay"
            name: newsletter
            widget: object
            fields:
              - { label: "Section label", name: section_label, widget: string }
              - { label: "Section h3", name: section_h, widget: string }
              - { label: "Section h3 em", name: section_h_em, widget: string }
              - { label: "Lead paragraph", name: lead, widget: text }
              - { label: "Email placeholder", name: email_placeholder, widget: string }
              - { label: "Subscribe button", name: subscribe_label, widget: string }
              - label: "Pill links (footer)"
                name: pills
                widget: list
                fields:
                  - { label: "Label", name: label, widget: string }
                  - { label: "Href ({base} resolves to /blog)", name: href, widget: string }
                  - { label: "External (target=_blank)", name: external, widget: boolean, default: false }

  # ──────────────────────────────────────────────────────────────────
  # BLOG POSTS
  # Schema mirrors src/content.config.ts → `blog`.
  # ──────────────────────────────────────────────────────────────────
  - name: blog
    label: "📝 Blog Posts"
    label_singular: "Post"
    folder: src/content/blog
    create: true
    slug: "{{slug}}"
    summary: "{{title}} — {{pubDate | date('MMM YYYY')}}{{#if featured}} · ★ FEATURED{{/if}}{{#if draft}} · DRAFT{{/if}}"
    sortable_fields: [pubDate, title]
    view_filters:
      - { label: "Published", field: draft, pattern: false }
      - { label: "Drafts only", field: draft, pattern: true }
      - { label: "Featured", field: featured, pattern: true }
    fields:
      - { label: "Title", name: title, widget: string, hint: "The headline. Keep it under ~70 chars for search snippets." }
      - { label: "Description", name: description, widget: text, hint: "1–2 sentence summary — shown in the listing and as the meta description." }
      - { label: "Publish Date", name: pubDate, widget: datetime, date_format: "YYYY-MM-DD", time_format: false, default: "" }
      - { label: "Updated Date", name: updatedDate, widget: datetime, date_format: "YYYY-MM-DD", time_format: false, required: false, hint: "Optional — set when meaningfully revising a published post." }
      - { label: "Social image (OG)", name: heroImage, widget: image, required: false, hint: "Used for link previews only. On-page art comes from the film library automatically." }
      - { label: "Film plate override", name: filmImage, widget: string, required: false, hint: "Optional path like /blog/film/film-03.jpg. Leave blank for the automatic slug-hashed plate." }
      - { label: "Category", name: category, widget: select, default: "Notes", options: ["Notes", "Essay", "Field Report", "Playbook", "Opinion", "Letters"], hint: "One per post — shown above the title and used to filter the index." }
      - { label: "Author", name: author, widget: string, default: "Varun Vashisht" }
      - { label: "Series (optional)", name: series, widget: string, required: false, hint: "If part of a series — name shown on the post + listing." }
      - { label: "Series part (optional)", name: seriesPart, widget: number, required: false, value_type: int, min: 1, hint: "Which part of the series this is." }
      - { label: "Pull quote (optional)", name: pullQuote, widget: text, required: false, hint: "Optional standalone line used as the homepage quote-of-the-dispatch when this post is featured." }
      - label: "Tags"
        name: tags
        widget: list
        required: false
        default: []
        hint: "Short keywords for search + related posts (PMO, AI, Agile, etc.)."
        field: { label: "Tag", name: tag, widget: string }
      - { label: "Reading minutes (override)", name: readingMinutes, widget: number, required: false, value_type: int, min: 1, max: 60, hint: "Leave blank to auto-compute at build time from body length." }
      - { label: "Featured", name: featured, widget: boolean, default: false, hint: "Pin this post to the top of the homepage as the cover story (overrides newest-first ordering)." }
      - { label: "Draft", name: draft, widget: boolean, default: true, hint: "Drafts are excluded from the listing and RSS feed on production builds." }
      - { label: "Body", name: body, widget: markdown }
