Update JSON Data
Update JSON Data
Section titled “Update JSON Data”Most of ForgeDocs’ content is stored in JSON files. This guide explains each file, what it controls, and how to edit it safely.
If you’re using Decap CMS, you can edit these files from the browser. If you’re using Code Only, edit them directly in your code editor.
Why JSON?
Section titled “Why JSON?”JSON (JavaScript Object Notation) is a simple text format for structured data. It looks like this:
{ "key": "value", "number": 42, "list": ["item1", "item2"], "nested": { "inner": "value" }}Rules to remember:
- Always use double quotes (
") — not single quotes (') - No trailing commas after the last item
- Keys must be unique within the same object
- Save with UTF-8 encoding
If your JSON is invalid, the build will fail. Use a JSON validator like jsonlint.com to check.
src/data/seo.json
Section titled “src/data/seo.json”Controls site-wide SEO metadata.
{ "title": "ForgeDocs — Astro Starlight Theme for SaaS & Docs", "description": "All-in-one Astro theme: landing page, Starlight docs, and blog.", "keywords": ["astro starlight theme", "astro theme", "saas docs theme"], "ogImage": "https://your-domain.com/og-image.jpg", "canonical": "https://your-domain.com", "author": "Your Name", "twitterSite": "@yourhandle", "twitterCreator": "@yourhandle", "locale": "en_US", "themeColorLight": "#ffffff", "themeColorDark": "#09090b", "favicon": "/favicon.svg", "appleTouchIcon": "/apple-touch-icon.png", "robots": "index, follow, max-image-preview:large", "product": { "name": "ForgeDocs", "price": "79", "currency": "USD", "availability": "InStock" }}Tips:
title— 50–60 charactersdescription— 150–160 characterskeywords— 5–10 relevant termsogImage— 1200×630px image
src/data/site.json
Section titled “src/data/site.json”Site metadata shown in the navbar and footer.
{ "name": "ForgeDocs", "version": "1.0.0", "tagline": "The last Astro Starlight theme you'll ever need.", "description": "All-in-one Astro theme: landing page, docs, blog.", "domain": "your-domain.com", "demo": "https://your-domain.com", "price": "$79", "license": "Lifetime — unlimited projects", "skipLink": "Skip to content", "mainId": "main-content"}version appears next to the brand name in the navbar. Update it when you release new versions.
src/data/navbar.json
Section titled “src/data/navbar.json”Navigation links and brand.
{ "brand": { "label": "ForgeDocs", "href": "/", "logo": "/logo.svg" }, "links": [ { "label": "Features", "href": "/features" }, { "label": "Contact", "href": "/contact" }, { "label": "Documentation", "href": "/introduction" }, { "label": "Buy for $79", "href": "https://creativitaz.gumroad.com/l/forgedocs", "variant": "primary" } ]}variant: "primary" renders the link as a button. Links without variant render as plain text.
src/data/footer.json
Section titled “src/data/footer.json”Footer columns, social links, and copyright.
{ "brand": { "label": "ForgeDocs", "tagline": "All-in-one Astro theme.", "logo": "/logo.svg" }, "columns": [ { "title": "Product", "links": [ { "label": "Features", "href": "/features" }, { "label": "Pricing", "href": "/#pricing" } ] }, { "title": "Resources", "links": [ { "label": "Blog", "href": "/blog" }, { "label": "FAQ", "href": "/faq" } ] } ], "social": [ { "label": "GitHub", "href": "https://github.com/you", "icon": "github" }, { "label": "Twitter", "href": "https://twitter.com/you", "icon": "twitter" } ], "bottom": { "copyright": "© 2026 ForgeDocs. All rights reserved.", "links": [ { "label": "Terms", "href": "/terms" }, { "label": "Privacy", "href": "/privacy" } ] }}Available social icons: github, discord, twitter
src/data/home.json
Section titled “src/data/home.json”The landing page content. This is the largest file.
{ "hero": { "badge": "New • Astro 4.0 Ready", "title": "Documentation", "highlight": "that sells itself.", "description": "All-in-one Astro theme...", "actions": [ { "label": "Buy for $79 →", "href": "https://gumroad.com/...", "variant": "primary" }, { "label": "View Demo", "href": "/introduction", "variant": "secondary" } ], "trust": [ { "label": "Unlimited" }, { "label": "Lifetime" }, { "label": "Full Green SEO" } ], "image": "https://images.unsplash.com/...", "imageFloat": "⚡ Full Green SEO Ready" }, "showcase": { "...": "..." }, "features": { "...": "..." }, "pricing": { "title": "One price. Forever.", "subtitle": "No subscription. Lifetime updates.", "plans": [ { "name": "Code Only", "price": "$79", "desc": "Full source code.", "features": ["Landing page", "Docs", "Blog"], "cta": "Buy for $79 →", "href": "https://gumroad.com/...", "featured": false } ] }, "cta": { "...": "..." }}Editing tips:
- Actions — each action has
label,href,variant(primaryorsecondary) - Trust badges — array of
{ label }objects - Pricing plans — the
featured: trueplan gets highlighted styling - Images — use full URLs or paths to files in
public/
src/data/features.json
Section titled “src/data/features.json”Content for the /features page.
{ "hero": { "badge": "Features", "title": "Everything you need.\nNothing you don't.", "desc": "ForgeDocs ships with landing page, docs, blog.", "image": "https://...", "imageAlt": "...", "float": "⚡ Full Green Lighthouse" }, "stats": [ { "value": "Full Green", "label": "Lighthouse SEO" } ], "showcase": { "title": "Built for founders\nwho ship fast.", "sub": "Fluent + shadcn hybrid." }, "features": [ { "title": "Landing Page", "desc": "Hero, features, pricing, CTA.", "image": "https://...", "imageAlt": "...", "accent": "light" } ]}\n in strings creates a line break when rendered.
src/data/contact.json
Section titled “src/data/contact.json”Contact page content and form configuration.
{ "hero": { "badge": "Contact", "title": "Let's talk.\nI reply within 24 hours.", "desc": "Questions about ForgeDocs?", "image": "https://...", "imageAlt": "..." }, "formspree_id": "your-formspree-id", "info": [ { "label": "Email", "value": "you@example.com" }, { "label": "Response time", "value": "< 24 hours" } ], "highlights": [ { "icon": "⚡", "title": "Fast reply", "desc": "..." } ], "fields": [ { "name": "name", "label": "Name", "type": "text", "placeholder": "Your name", "required": true }, { "name": "email", "label": "Email", "type": "email", "placeholder": "you@example.com", "required": true }, { "name": "message", "label": "Message", "type": "textarea", "placeholder": "Your message", "required": true } ]}formspree_id — Get this from formspree.io. Create a form, copy the ID (the part after /f/ in the URL).
Supported field types: text, email, tel, textarea
src/data/faq.json
Section titled “src/data/faq.json”FAQ content for the /faq page.
{ "title": "Frequently Asked Questions", "description": "Common questions about ForgeDocs.", "items": [ { "question": "What is ForgeDocs?", "answer": "An all-in-one Astro theme." } ]}src/data/blog.json
Section titled “src/data/blog.json”Text labels used across blog pages.
{ "list": { "title": "Blog", "description": "Latest articles from ForgeDocs.", "backLink": "← Back to blog", "readMore": "Read more →" }, "pagination": { "prev": "← Prev", "next": "Next →", "pageInfo": "Page {current} of {total}" }, "tag": { "title": "#{tag}", "description": "{count} post tagged with {tag}.", "descriptionPlural": "{count} posts tagged with {tag}." }}{current}, {total}, {tag}, {count} are placeholders replaced at render time.
Editing Safely
Section titled “Editing Safely”Always:
- Back up before editing — copy the file to
file.json.bak - Validate JSON — use jsonlint.com after editing
- Check for missing commas — the most common JSON error
- Test locally — run
npm run devand check your changes - Commit often — small commits are easier to revert
Never:
- Delete required fields (check the examples above)
- Change key names (only change values)
- Use single quotes or trailing commas
- Add BOM (byte order mark) to the file
Common JSON Errors
Section titled “Common JSON Errors”Missing comma
Section titled “Missing comma”{ "title": "ForgeDocs" "description": "An Astro theme"}Fix: Add a comma after "ForgeDocs".
Trailing comma
Section titled “Trailing comma”{ "items": [ "one", "two", ]}Fix: Remove the comma after "two".
Single quotes
Section titled “Single quotes”{ "title": 'ForgeDocs'}Fix: Use double quotes: "ForgeDocs".
Unescaped quotes in strings
Section titled “Unescaped quotes in strings”{ "description": "He said "hello""}Fix: Escape inner quotes: "He said \"hello\"".
Testing Your Changes
Section titled “Testing Your Changes”After editing a JSON file:
- Save the file
- The dev server reloads automatically
- Open
http://localhost:4321 - Verify the change appears
If the site doesn’t load, check the terminal for a JSON parse error. It will tell you the line number.
What’s Next
Section titled “What’s Next”Now that you can edit JSON, learn about Markdown content:
→ Others
Need Help?
Section titled “Need Help?”If you’re stuck:
- Check the FAQ
- Email creativebydre@gmail.com
- For custom work, hire me on Fiverr