Skip to content

feat: multi-version llms output via versions option - #56

Merged
rachfop merged 1 commit into
mainfrom
feat/multi-version-output
Jul 17, 2026
Merged

rachfop merged 1 commit into
mainfrom
feat/multi-version-output

Conversation

@rachfop

@rachfop rachfop commented Jul 17, 2026

Copy link
Copy Markdown
Owner

What

Adds a versions plugin option to generate a separate set of LLM files per documentation version. Each version runs the full pipeline — writing llms.txt and every customLLMFiles entry under its own subdirectory, with links scoped to that version's routes.

versions accepts either:

  • an explicit array — { name, label?, docsDir?, path?, customLLMFiles?, includeOrder? } per version, or
  • 'auto' — detected from Docusaurus docs versioning (versions.json + versioned_docs/), reading labels/paths from the docs config (preset or standalone plugin-content-docs).

Unset per-version fields fall back to the top-level options. Omitting versions preserves the existing single-root behavior exactly.

Why

Sites that keep more than one docs version live at once (e.g. a nightly build at the root and a stable build under /stable) currently get only a single root llms.txt covering the default version. This lets each version publish its own machine-readable index at /<path>/llms.txt.

Notes

  • Custom files now inherit the version label (customFile.version ?? version) so version-scoped outputs like stable/llms-python.txt are labeled consistently with their llms.txt.
  • writeFile now creates parent directories so version subdirectories are written.
  • Route resolution is scoped per version: versioned files link within their subtree, and the root version excludes versioned subtrees so its links don't leak.

Test plan

npm test — adds tests/test-multi-version.js covering explicit arrays, 'auto' (both preset- and plugins-based content-docs config), backward compatibility, validation, scoped links, and custom-file labeling. Full suite green.

@rachfop
rachfop force-pushed the feat/multi-version-output branch 2 times, most recently from 8c82582 to 8165680 Compare July 17, 2026 16:38
Generate a separate set of LLM files per documentation version. Each version
runs the full pipeline, writing llms.txt and all customLLMFiles under its own
subdirectory with links scoped to that version's routes.

`versions` accepts an explicit array ({ name, label, docsDir, path,
customLLMFiles, includeOrder }) or 'auto' to detect versions from Docusaurus
docs versioning (versions.json + versioned_docs/). Unset per-version fields
fall back to the top-level options. Omitting `versions` preserves the existing
single-root behavior.

Custom files now inherit the version label (customFile.version ?? version) so
version-scoped outputs like stable/llms-python.txt are labeled consistently.
writeFile creates parent directories so version subdirectories are written.

Adds tests/test-multi-version.js (explicit array, auto detection, backward
compat, validation, scoped links, custom-file labeling) and documents the
option in the README and CHANGELOG.
@rachfop
rachfop force-pushed the feat/multi-version-output branch from 8165680 to 306baba Compare July 17, 2026 16:54
@rachfop
rachfop marked this pull request as ready for review July 17, 2026 16:54
@rachfop
rachfop merged commit a2a23a0 into main Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant