This repository powers the Genkit documentation site using Astro + Starlight.
Current language architecture:
- Source docs are authored once per topic in
src/content/docs/docs/**/*.mdx. - Language-specific content inside a page uses
<Lang lang="...">...</Lang>. - Supported languages per page are declared in frontmatter using
supportedLanguages. - Language-specific route files are generated into
src/content/docs/docs/{js,go,dart,python}/.... - Canonical language routes use
/docs/{lang}/{slug}/for language-variant pages. - Source docs should generally link using neutral
/docs/{slug}/routes; generation/runtime resolves to language-specific targets.
.
├── public/
├── src/
│ ├── assets/
│ ├── components/
│ ├── content/
│ │ └── docs/
│ │ └── docs/ # source + generated language pages
│ ├── scripts/
│ │ └── generate-language-pages.ts
│ └── content.config.ts
├── astro.config.mjs
└── package.json
For each docs page:
- Keep one source file in
src/content/docs/docs/. - Add frontmatter:
supportedLanguages: [js, go, dart, python](subset allowed)- optional
isLanguageAgnostic: truefor shared pages
- Use
<Lang>blocks only where content differs by language. - Keep common content outside language blocks.
- Use neutral internal docs links (
/docs/<slug>/) in source files; do not manually hardcode/docs/js/...or other language-prefixed routes unless intentional.
See DOCUMENTATION-GUIDANCE.md for full authoring standards.
All commands run from repo root:
| Command | Action |
|---|---|
pnpm install |
Install dependencies |
pnpm generate-language-pages |
Generate /docs/{lang}/... content files from unified source docs |
pnpm dev |
Generate language pages and start local dev server |
pnpm build |
Generate language pages, build docs bundles/llms files, and build site |
pnpm preview |
Preview the production build |
pnpm build-llms-direct |
Generate llms*.txt outputs directly from docs source |
Before opening a PR:
- Run
pnpm generate-language-pages. - Run
pnpm build-bundleandpnpm build-llms-direct. - Ensure docs routes load locally (
pnpm dev). - Commit source docs and code changes only.
- Do not commit generated language pages or generated llms artifacts (both are gitignored build artifacts).
- Expect non-blocking warnings if a language page must link to a different language variant because that target is unavailable in the current language.