This repository generates language-aware llms.txt outputs directly from the unified docs source.
- Source docs live in
src/content/docs/docs/**/*.mdx. - Each page declares language availability in frontmatter:
supportedLanguages: [js, go, dart, python](subset allowed)- optional
isLanguageAgnostic: true
- Language deltas in body content use
<Lang lang="...">...</Lang>.
Running pnpm build-llms-direct generates:
public/llms.txt(index)public/llms-full.txt(unfiltered aggregate)public/llms-js.txtpublic/llms-go.txtpublic/llms-dart.txtpublic/llms-python.txtpublic/_llms-txt/*.txtthematic sets per language
These files are build artifacts and are gitignored.
llms outputs must align with the docs routing model:
- Language-variant pages reference canonical URLs as
/docs/{lang}/{slug}. - Language-agnostic pages reference canonical URLs as
/docs/{slug}. - Redirect-only/query-param variants are not emitted.
Source docs should use neutral internal docs links (/docs/<slug>/). During generation, links are rewritten per output language:
- supported target in active language ->
/docs/{lang}/{slug}/ - unsupported target in active language -> canonical fallback language path
- language-agnostic target -> neutral
/docs/{slug}/
The generator applies the same language rules used by docs navigation and routing:
- Parse frontmatter for
supportedLanguagesandisLanguageAgnostic. - Process MDX content with
<Lang>block filtering per language. - Include shared content in all language outputs.
- Exclude pages where a language is not supported.
- Include agnostic pages in all language-specific outputs.
pnpm build-llms-direct: generate LLM text files onlypnpm build: full production build (includes llms generation)
When updating docs or language metadata:
- Run
pnpm generate-language-pages. - Run
pnpm build-llms-direct. - Run
pnpm buildbefore opening a PR. - Do not commit generated language pages or generated
public/llms*.txtfiles.