Skip to content

genkit-ai/docsite

Repository files navigation

Genkit.dev Docsite

Built with Starlight

Overview

This repository powers the Genkit documentation site using Astro + Starlight.

Current language architecture:

  1. Source docs are authored once per topic in src/content/docs/docs/**/*.mdx.
  2. Language-specific content inside a page uses <Lang lang="...">...</Lang>.
  3. Supported languages per page are declared in frontmatter using supportedLanguages.
  4. Language-specific route files are generated into src/content/docs/docs/{js,go,dart,python}/....
  5. Canonical language routes use /docs/{lang}/{slug}/ for language-variant pages.
  6. Source docs should generally link using neutral /docs/{slug}/ routes; generation/runtime resolves to language-specific targets.

Key Directories

.
├── public/
├── src/
│   ├── assets/
│   ├── components/
│   ├── content/
│   │   └── docs/
│   │       └── docs/               # source + generated language pages
│   ├── scripts/
│   │   └── generate-language-pages.ts
│   └── content.config.ts
├── astro.config.mjs
└── package.json

Writing Docs

For each docs page:

  1. Keep one source file in src/content/docs/docs/.
  2. Add frontmatter:
    • supportedLanguages: [js, go, dart, python] (subset allowed)
    • optional isLanguageAgnostic: true for shared pages
  3. Use <Lang> blocks only where content differs by language.
  4. Keep common content outside language blocks.
  5. 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.

Commands

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

Contribution Notes

Before opening a PR:

  1. Run pnpm generate-language-pages.
  2. Run pnpm build-bundle and pnpm build-llms-direct.
  3. Ensure docs routes load locally (pnpm dev).
  4. Commit source docs and code changes only.
  5. Do not commit generated language pages or generated llms artifacts (both are gitignored build artifacts).
  6. Expect non-blocking warnings if a language page must link to a different language variant because that target is unavailable in the current language.

About

Genkit's documentation and website, built by Google on Astro

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors