Skip to content

Auto-generate docs sidebar and content from .svx frontmatter#2

Merged
tbjers merged 2 commits into
mainfrom
refactor/docs-auto-sidebar
Jul 1, 2026
Merged

Auto-generate docs sidebar and content from .svx frontmatter#2
tbjers merged 2 commits into
mainfrom
refactor/docs-auto-sidebar

Conversation

@tbjers

@tbjers tbjers commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add src/lib/docs-content/index.ts as a single source of truth: globs all .svx files, sorts by filename prefix, and exports sections (for DocsContent) and sidebarGroups (for DocsSidebar)
  • Add group frontmatter field to all 15 .svx files — needed because the existing kicker field is a display label and doesn't map 1:1 to sidebar groups (e.g. how-it-works has kicker: architecture but belongs to the "Getting started" group)
  • Refactor DocsSidebar.svelte to replace the hardcoded 22-line groups array with a one-line import
  • Refactor DocsContent.svelte to replace its inline glob with an import from the shared module

Adding a new doc now only requires a new .svx file with id, title, and group frontmatter — no component edits needed.

Test plan

  • pnpm dev — docs page renders all sections in correct order with correct sidebar groups
  • pnpm check — no new type errors
  • pnpm build — clean prerender build

🤖 Generated with Claude Code

Add a shared index.ts that globs all .svx files and derives both
the section list (DocsContent) and sidebar groups (DocsSidebar)
from frontmatter. Add `group` field to all .svx files so sidebar
grouping is explicit and independent of the display-only `kicker`
field. Adding a new doc now requires only a new .svx file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploying coveragetracker-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4c3d4d6
Status: ✅  Deploy successful!
Preview URL: https://8dc69bb7.coveragetracker-dev.pages.dev
Branch Preview URL: https://refactor-docs-auto-sidebar.coveragetracker-dev.pages.dev

View logs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tbjers
tbjers merged commit 6a18344 into main Jul 1, 2026
2 checks passed
@tbjers
tbjers deleted the refactor/docs-auto-sidebar branch July 1, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant