2.7 KiB
2.7 KiB
@gram-lang/docs
The Gram documentation site and browser playground: gram-lang.org. Built with Astro + Starlight, with a Vue-based playground island.
Structure
src/
├── components/ # Astro components (homepage, DocsHome, ChangelogPage, Sidebar, overrides)
│ └── playground/ # Vue playground: editor, output panes, options
├── content/
│ ├── docs/ # Starlight docs collection (EN at docs/docs/**, FR at docs/fr/docs/**)
│ └── blog/ # Blog posts (en/, fr/)
├── data/ # Structured content: homepage copy, terms, blog topics, API reference data
├── layouts/ # Layout.astro — shared shell for non-Starlight pages (home, blog, playground)
├── lib/ # Shared utilities (changelog/release loaders, head scripts, FR/EN resolution)
├── pages/ # Astro routes; fr/ mirrors the English tree
└── styles/ # global.css and starlight/layers.css
Routing: Starlight docs live under /docs/** and /fr/docs/** (not at the root) purely via content-collection file layout, so they don't collide with the Astro-native homepage at /.
Commands
Run from this directory, or via turbo/bun run --filter=@gram-lang/docs <script> from the repo root:
| Command | Action |
|---|---|
bun dev |
Start the dev server at localhost:4321 |
bun run build |
Build the static site to ./dist/, then check bundle size |
bun run preview |
Preview the production build locally |
bun run typecheck |
Run astro check and vue-tsc |
No environment variables are required — the site builds fully statically, with no runtime secrets.
Notes
astro/@astrojs/starlight/@astrojs/vue/@astrojs/mdx/@astrojs/markdown-remarkare pinned to the current stable range inpackage.json(astro^7.4.x/ Starlight^0.43.x); keep them on^7.1.x/Starlight^0.41.xor later —astro@7.0.2's dev server is broken in this hoisted Bun monorepo (fixed in7.1.5).scripts/check-bundle-size.mjsenforces a size budget on the playground's JS chunk (CodeMirror 6 + Shiki, self-hosted); raise the budget deliberately in that file if a change legitimately grows it.scripts/vendor-starlight-tokens.tsandscripts/generate-llms-full.tsrun asprebuildsteps (syncing Starlight tokens and regeneratingpublic/llms-full.txt/llms.txt).