Skip to content

Latest commit

 

History

History

astro-starlight-before

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

astro-starlight-before

The source side of the Astro Starlight → TanStack CMS migration example: a small, real Starlight docs site.

It's a standard Starlight project — a docs content collection (src/content.config.ts using docsLoader() + docsSchema()) and a handful of Markdown/MDX pages under src/content/docs/ with frontmatter (title, description, sidebar, draft). The sidebar is derived from the file tree (astro.config.mjs).

src/content/docs/
  index.mdx                 landing page — uses <Card>/<CardGrid> (MDX, the gap surface)
  start/getting-started.md  sidebar.order 1
  start/installation.md     sidebar.order 2
  guides/widgets.md         rich body: headings, list, code, table, blockquote, link
  guides/theming.md         draft: true  (→ published:false after migration)
  reference/configuration.md

Run

pnpm install           # from the repo root
pnpm --filter astro-starlight-before dev    # → http://localhost:3012

Why this is the easy inverse of Payload

Payload stores rich text as a Lexical editor-state tree — the hard case, needing a Lexical→Markdown walker. Starlight bodies are already Markdown, and they live as plain files on disk (no database, no REST API). So the migration (../astro-starlight-after) just reads these files, parses frontmatter, and carries each body across 1:1 into a core richText block. The only real gap is MDX (components like <Card> have no Markdown equivalent), plus the sidebar/nav tree and cross-page links.