This guide defines how to author and maintain docs in the current language-aware architecture.
Use Genkit as the product name. Do not use "Firebase Genkit" in docs content.
For every doc page:
- Keep a single source file under
src/content/docs/docs/. - Set frontmatter
supportedLanguages. - Set
isLanguageAgnostic: trueonly if the page should have one shared canonical URL. - Use
<Lang>only for language-specific deltas. - Keep shared prose outside
<Lang>blocks. - Author internal docs links as neutral routes (
/docs/<slug>/) unless intentionally language-pinned.
All docs pages should declare language support explicitly:
---
title: Example Page
description: What this page covers.
supportedLanguages: [js, go, python]
---Optional for fully shared pages:
---
title: Feedback
description: How to send feedback.
supportedLanguages: [js, go, dart, python]
isLanguageAgnostic: true
---Use the Lang component for content differences.
import Lang from '../../../components/Lang.astro';
Common setup steps for all languages.
<Lang lang="js go">{/* JavaScript and Go-specific pattern notes */}</Lang>
<Lang lang="python">{/* Python-specific details */}</Lang>Rules:
langaccepts one or more values fromjs,go,dart,python.- Only include languages also declared in
supportedLanguages. - Do not wrap entire pages in
Langunless every section is truly language-specific. - Do not use legacy
LanguageContent. - Never refer to multiple languages within a single shared block of copy. The copy must be kept completely language-neutral, or if language-specific references are necessary, must use separate
<Lang>tags for each language variant (Exception: It is acceptable and necessary to reference multiple languages when describing cross-language boundaries, such as connecting a JS/TS frontend framework or Flutter client to a standalone Go/Python/Dart backend).
Use this for pages with language-specific implementation details.
- Canonical URLs are
/docs/{lang}/{slug}. - Neutral
/docs/{slug}is a redirect/dispatcher URL. - Sidebar visibility depends on selected language and
supportedLanguages.
Use isLanguageAgnostic: true when content is truly shared.
- Canonical URL is
/docs/{slug}. - Do not author language-specific duplicates.
- Page stays visible in sidebar for all language selections.
- Language selector is global (top of left docs nav).
- Sidebar is filtered to pages supporting the selected language.
- On language switch, if current page is unavailable in the selected language, navigation falls back to a valid page in that language.
- Fallback priority for redirects is:
js > go > dart > python.
Author impact: if a page should appear for a language, include that language in supportedLanguages.
Author links in source docs as neutral docs routes:
- Preferred:
/docs/flows/ - Avoid in source docs:
/docs/js/flows/,/docs/go/flows/(unless intentionally language-pinned)
Why:
- Build/runtime rewrite resolves links to the active language variant when available.
- If a target is unsupported in the active language, links resolve to the canonical fallback language.
- Language-agnostic pages remain neutral (
/docs/<slug>/). - Copy-as-markdown and
llms-*.txtoutputs use the same rewrite behavior.
Generation emits non-blocking warnings when a language page must link to another language variant (for example, Go page linking to a JS-only target). These warnings help identify missing language coverage but do not fail the build.
- Prefer direct language over theory-heavy explanations.
- Explain "why" briefly, then show working examples.
- Use sentence case for all headings and admonition titles (e.g., "Getting started with Genkit").
- Preserve capitalization for proper nouns, product names (e.g., "Cloud Functions for Firebase", "Genkit", "Agent Skills"), and pure acronyms (e.g., "API", "JSON").
- Preserve internal capitalization for code-specific words (camelCase, PascalCase) within headings (e.g., "InMemoryStreamManager").
- Keep parallel section structure across languages.
- Use the same terminology and concept names across pages.
- Must be runnable/copyable with minimal edits.
- Keep examples aligned across languages where possible.
- Prefer current recommended models and packages.
- Link related docs on first relevant mention.
- Add a short "Learn more" section when useful.
- Never fabricate unsupported functionality.
- If unsupported in a language, include clear notes and alternatives.
Supported Starlight callout blocks:
:::note:::tip:::caution:::danger
Use callouts sparingly for high-signal information.
Pages include a "Copy as Markdown" action in the page title area. Keep heading structure clean and avoid unnecessary wrapper markup so copied output remains readable. Generated-file warning comments are removed from markdown export/copy output.
Run from repo root:
pnpm generate-language-pagespnpm build-bundlepnpm build-llms-directpnpm build
Generated language pages and generated llms output are build artifacts and are ignored by git.