# ========================================================
# SVELTIA CMS CONFIGURATION FOR ASTRO BLOG CMS
# Place in: public/admin/config.yml
# ========================================================

backend:
  name: github
  repo: amitsi07/my-astro-blog
  branch: main

# Media Uploads Directory (Relative to project root and public URL)
media_folder: "public/uploads"
public_folder: "/uploads"

# Display & UI Settings
site_url: "https://my-astro-blog.pages.dev"
display_url: "https://my-astro-blog.pages.dev"
logo_url: "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&w=120&h=120&q=80"

publish_mode: simple
show_preview_links: true

collections:
  - name: "posts"
    label: "Articles & Blog Posts"
    label_singular: "Article"
    folder: "src/content/blog"
    create: true
    slug: "{{slug}}"
    preview_path: "{{slug}}"
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Subtitle", name: "subtitle", widget: "string", required: false }
      - { label: "Slug / Clean URL", name: "slug", widget: "string" }
      - { label: "Published Date", name: "publishedAt", widget: "datetime" }
      - { label: "Status", name: "status", widget: "select", options: ["published", "draft", "scheduled"], default: "published" }
      - { label: "Category", name: "category", widget: "string" }
      - { label: "Tags", name: "tags", widget: "list" }
      - { label: "Author", name: "author", widget: "string", required: false, default: "Admin" }
      - { label: "Featured Hero Image", name: "featuredImage", widget: "image", required: false }
      - { label: "Image Alt Text", name: "featuredImageAlt", widget: "string", required: false }
      - { label: "Image Caption", name: "featuredImageCaption", widget: "string", required: false }
      - { label: "Photo Credit", name: "featuredImageCredit", widget: "string", required: false }
      - { label: "Show in Post Header", name: "showFeaturedImageInPost", widget: "boolean", default: true }
      - { label: "Featured on Homepage", name: "isFeatured", widget: "boolean", default: false }
      - { label: "Trending Badge", name: "isTrending", widget: "boolean", default: false }
      - { label: "Allow Reader Comments", name: "allowComments", widget: "boolean", default: true }
      - { label: "Excerpt / Summary", name: "excerpt", widget: "text" }
      - { label: "Article Body (Markdown)", name: "body", widget: "markdown" }
      - { label: "SEO Meta Title", name: "seoTitle", widget: "string", required: false }
      - { label: "SEO Meta Description", name: "metaDescription", widget: "text", required: false }

  - name: "pages"
    label: "Static Pages"
    label_singular: "Page"
    folder: "src/content/pages"
    create: true
    slug: "{{slug}}"
    preview_path: "{{slug}}"
    fields:
      - { label: "Page Title", name: "title", widget: "string" }
      - { label: "Slug / Path", name: "slug", widget: "string" }
      - { label: "Published", name: "isPublished", widget: "boolean", default: true }
      - { label: "Page Content (Markdown)", name: "body", widget: "markdown" }
      - { label: "SEO Title", name: "seoTitle", widget: "string", required: false }
      - { label: "Meta Description", name: "metaDescription", widget: "text", required: false }

  - name: "categories"
    label: "Categories"
    folder: "src/content/categories"
    create: true
    slug: "{{slug}}"
    fields:
      - { label: "Category Name", name: "name", widget: "string" }
      - { label: "Slug", name: "slug", widget: "string" }
      - { label: "Description", name: "description", widget: "text" }
      - { label: "Brand Color (Hex)", name: "color", widget: "color" }

  - name: "tags"
    label: "Tags"
    folder: "src/content/tags"
    create: true
    slug: "{{slug}}"
    fields:
      - { label: "Tag Name", name: "name", widget: "string" }
      - { label: "Slug", name: "slug", widget: "string" }

  - name: "homepage"
    label: "Homepage Builder"
    files:
      - label: "Hero Banner & Sections"
        name: "hero_and_sections"
        file: "src/data/homepage.json"
        fields:
          - { label: "Hero Headline", name: "heroHeadline", widget: "string" }
          - { label: "Hero Subheadline", name: "heroSubheadline", widget: "text" }
          - { label: "Hero CTA Button Label", name: "heroCtaText", widget: "string", default: "Explore Articles" }
          - { label: "Hero CTA URL", name: "heroCtaUrl", widget: "string", default: "/articles" }
          - { label: "Hero Background Image", name: "heroImage", widget: "image", required: false }
          - { label: "Featured Section Title", name: "featuredSectionTitle", widget: "string", default: "Featured Stories" }
          - { label: "Trending Section Title", name: "trendingSectionTitle", widget: "string", default: "Trending Now" }
          - { label: "Newsletter Headline", name: "newsletterHeadline", widget: "string", default: "Subscribe to our Dispatch" }
          - { label: "Newsletter Subtext", name: "newsletterSubtext", widget: "text", default: "Weekly curated intelligence delivered straight to your inbox." }

  - name: "menus"
    label: "Navigation Menus"
    files:
      - label: "Header & Footer Menu Items"
        name: "menu_items"
        file: "src/data/menus.json"
        fields:
          - label: "Navigation Links"
            name: "items"
            widget: "list"
            fields:
              - { label: "Label", name: "label", widget: "string" }
              - { label: "URL", name: "url", widget: "string" }
              - { label: "Open in New Tab", name: "targetNewTab", widget: "boolean", default: false }

  - name: "users"
    label: "Users & Authors"
    folder: "src/content/authors"
    create: true
    slug: "{{slug}}"
    fields:
      - { label: "Full Name", name: "name", widget: "string" }
      - { label: "Slug / Username", name: "slug", widget: "string" }
      - { label: "Email", name: "email", widget: "string" }
      - { label: "Role", name: "role", widget: "select", options: ["admin", "editor", "author", "contributor"], default: "author" }
      - { label: "Avatar Image", name: "avatar", widget: "image", required: false }
      - { label: "Biography", name: "bio", widget: "text" }
      - { label: "Twitter / X Profile", name: "twitter", widget: "string", required: false }
      - { label: "GitHub Profile", name: "github", widget: "string", required: false }

  - name: "redirects"
    label: "301 URL Redirects"
    files:
      - label: "Redirect Rules"
        name: "redirect_rules"
        file: "src/data/redirects.json"
        fields:
          - label: "Rules List"
            name: "rules"
            widget: "list"
            fields:
              - { label: "Source Path (from)", name: "from", widget: "string" }
              - { label: "Target URL (to)", name: "to", widget: "string" }
              - { label: "Status Code", name: "code", widget: "select", options: ["301", "302"], default: "301" }

  - name: "ads"
    label: "Ads & Monetization"
    files:
      - label: "Ad Placements"
        name: "ad_placements"
        file: "src/data/ads.json"
        fields:
          - { label: "Enable Monetization", name: "isEnabled", widget: "boolean", default: false }
          - { label: "Header Banner Ad Code", name: "headerBannerCode", widget: "text", required: false }
          - { label: "In-Article Ad Code", name: "inArticleCode", widget: "text", required: false }
          - { label: "Sidebar Ad Code", name: "sidebarCode", widget: "text", required: false }
          - { label: "Footer Ad Code", name: "footerCode", widget: "text", required: false }

  - name: "settings"
    label: "Site Settings & Branding"
    files:
      - label: "General & Branding"
        name: "general_settings"
        file: "src/data/settings.json"
        fields:
          - { label: "Site Name", name: "siteName", widget: "string" }
          - { label: "Tagline", name: "tagline", widget: "string" }
          - { label: "Site Description", name: "description", widget: "text" }
          - { label: "Site URL", name: "siteUrl", widget: "string", required: false }
          - { label: "Logo URL", name: "logoUrl", widget: "image", required: false }
          - { label: "Favicon URL", name: "faviconUrl", widget: "image", required: false }
          - { label: "Posts Per Page", name: "postsPerPage", widget: "number", default: 9 }
          - { label: "Copyright Text", name: "footerCopyright", widget: "string", default: "All rights reserved." }

  - name: "seo"
    label: "SEO & Social Sharing"
    files:
      - label: "SEO Metadata & Socials"
        name: "seo_settings"
        file: "src/data/seo.json"
        fields:
          - { label: "Default Meta Title", name: "metaTitle", widget: "string" }
          - { label: "Default Meta Description", name: "metaDescription", widget: "text" }
          - { label: "Social Share Card (OG Image)", name: "ogImage", widget: "image", required: false }
          - { label: "Twitter / X Handle", name: "twitterHandle", widget: "string", required: false }
          - { label: "Google Analytics 4 ID", name: "gaMeasurementId", widget: "string", required: false }
          - { label: "Google Search Console Verification", name: "googleSiteVerification", widget: "string", required: false }
