Repository navigation
Releases
v0.6.2
This release points links between docs at each target's generated Markdown file, and writes the Markdown copy for a route that ends in .md beside its route directory instead of failing the run. Docs are at https://rachfop.github.io/docusaurus-plugin-llms.
Fixed
- In a site with
versions, blog posts reach every version's custom LLM files,
so a custom file whoseincludePatternsmatch the blog directory is written
for versions under a path prefix as well. The posts' markdown files keep
their unprefixed links and are written once, at the site root. - A docs section that points at the blog directory keeps its documents in every
version: only posts collected throughincludeBlogcount as unversioned
content, so every version keeps them in its standard files. - With
generateMarkdownFilesenabled, relative links between docs point to
each target's generated Markdown file in per-page copies,llms-full.txt,
and full-content custom files. Inline and reference-style links keep their
query strings and fragments;useRelativeUrlswrites these targets as paths
from the site root (#97). - The plugin writes the Markdown copy for a route that ends in
.mdas
fiber.md.md, beside Docusaurus'sfiber.md/index.htmlroute directory. If
a copy cannot be written, the plugin logs the path, links the page's HTML
route, and writes the remaining LLM files (#98).
v0.6.1
This release fixes how links, Markdown file paths, and content are generated for versioned, translated, and multi-section sites, and adds lint and format checks to the repo. Docs are at https://rachfop.github.io/docusaurus-plugin-llms.
Added
versions[].routePrefix, for explicit versions served inside the route base
path (/docs/<version>/) (#88).
Changed
versions: 'auto'follows Docusaurus versioning: the last version writes the
root files, the current docs go undernext/with the labelNext, and the
docs plugin'slastVersion,includeCurrentVersion,onlyIncludeVersions,
anddisableVersioningoptions apply (#88, #93).- Each locale's files use the page translations in
i18n/<locale>/(#88). - HTML tables, line breaks, and
<img>tags become Markdown text and images,
and HTML and MDX comments are removed (#85). - Duplicate
llms-full.txtheadings get a space before the suffix:
## Install (Api)(#86). - Option validation rejects output paths outside the build directory,
duplicate output file names, aprocessingBatchSizethat isn't a positive
integer, and invalid per-version options (#78, #84, #88).
Fixed
- Links and Markdown file paths match the routes Docusaurus builds for index
and README pages, slugs and ids, number-prefixed files, date-prefixed blog
posts, multi-section andbaseUrlsites, and paths with spaces or accents
(#74, #77, #87). - Content cleaning keeps prose lines that start with "import", code samples
inside partials, and blank lines inside code, and long JSX tags don't hang
the build (#85). - Page descriptions skip code fences, tables, admonitions, JSX, and comments,
and a wrapped first paragraph is joined before it's truncated (#76, #85,
#86). - Generated files stay inside the build directory and don't overwrite each
other (#84). - Empty and unclosed code fences are left as written,
<img>tags with a
require()source become Markdown images, and@site/images are
rewritten (#92). logLevel: 'quiet'prints errors only, and each plugin instance uses its
own level (#78, #86).- Titles with brackets or line breaks, components in
preserveComponents
named like HTML tags,TabItemlabels, the blog heading on multi-section
sites, and image rewriting for relative paths (#86).
Documentation
v0.6.0
This release ships a large batch of correctness fixes across content cleaning, partial resolution, output assembly, multi-version handling, and URL construction, plus a fully rewritten documentation set published at https://rachfop.github.io/docusaurus-plugin-llms.
Fixed
<TabItem label="A > B">leaked tag fragments: the TabItem label
emitter cut its tag match at the first>, so a quoted label containing>
dumped the rest of the tag into the output as prose. The matcher is now
attribute-aware, like the PascalCase stripper.- Multi-line descriptions rendered as broken blockquotes: a frontmatter
description spanning lines quoted only its first line, leaving the rest as
prose under the heading. Every line is now blockquoted. $sequences corrupted partial content: partial files were spliced
with a string replacement, so shell/perl patterns likeecho $1,kill $$,
or$&in a partial's code samples were silently rewritten (attr values
substituted, tags re-inserted, document fragments duplicated). The splice
now ignores replacement patterns.- CRLF line endings corrupted output: files authored or checked out with
Windows line endings had their fenced code blocks unmasked (imports and HTML
inside code samples were stripped) and their descriptions mis-extracted (a
heading-only file got the heading as description; a heading-less file got
the entire document).readFilenow normalizes CRLF/CR to LF. - Root slug (
slug: "/") crossed version subtrees: in multi-version
mode, a section-root page linked to the current version's route (e.g.
/docs) instead of its own version's (/stable/docs). Root-slug resolution
now honors version and section scoping. siteConfig.urlwith a trailing slash produced//baseUrlin every
generated URL, mismatching sitemap.xml.routeBasePathwith a leading/trailing slash (e.g.'/docs') silently
disabled route scoping for that section, falling every doc back to
heuristic URLs. Slashes are now normalized.- Blog detection misclassified sibling sections: any directory whose name
merely started with the blog dir (e.g. ablog-apidocs section next to
blog) was treated as the blog for fallback URL construction. - Code-fence samples containing
importstatements were rewritten: a
fenced sample of an import line was resolved as a real partial import and
spliced the partial's content into the code sample (or dropped the line when
the target did not exist). Partial-import resolution now runs on fence-masked
content. llms-full.txtflattened heading hierarchy: each document's inner
## Foostayed at##, colliding with the## {title}document header, and
the document's own title H1 appeared again under its header. Inner headings
are now demoted one level under the document header, and the duplicate title
heading is removed.- Individual
.mdfiles duplicated their title and intro: the file header
emitted# {title}plus the description blockquote, then the body repeated
the identical H1 and (for pages whose description was auto-extracted from
the first paragraph) the identical paragraph. Both duplicates are now
stripped from the body. - Triple blank lines in
llms-full.txt: stripping a body's duplicate
title heading left its surrounding blank lines behind. Gaps now collapse to
a single blank line. - Numeric frontmatter
descriptiondropped: an unquoted YAML number
(description: 2024) was silently discarded instead of used as text; it is
now coerced liketitle/slug/id. applyMdExtensionmangled bare origins: a bare site URL would become
https://site.com.md; the trailing slash is now preserved.
Added
preserveComponentsoption: an array of MDX/JSX component names whose
tags pass through untouched instead of being stripped, for components that
render meaningful content themselves (e.g. a swizzled
<PackageManagerTabs command="add my-package" />). Matching is exact on
the component name, and tags inside code fences are still left alone.
(#64)- CI workflow: the repository now runs build + unit + integration tests on
Node 18/20/22 for every pull request and push tomain.
Fixed
- Prop content lost in JSX stripping: the attribute-aware stripper
(0.5.0) dropped non-childrenprop values wholesale, deleting content like
the command inside<PackageManagerTabs command="..." />. Attribute values
are now parsed and their text is preserved. (#68,
#64) <TabItem>collapsed its label:<TabItem>tags now degrade to a
readable outline instead of a bare body: thelabel(orvalue) is emitted
as a bold line before the tab body. (#64)- Imported MDX page bodies silently dropped: only imports whose path
contained_or/partials/were inlined; a normally-named.mdxpage body
imported as a component was stripped without its content. Every.mdx/.md
import is now inlined, and imports using webpack-style aliases other than
@site(e.g.@global/components/x.mdx) resolve against the site directory.
Failed resolutions warn with the specifier and importing file. (#65) - Imports inside partial code fences stripped: when a partial was inlined,
importlines inside its fenced code samples were removed. Code fences are
masked before partial splicing, so samples survive verbatim. (#69) - Absolute slugs double-prefixed: a frontmatter
slugstarting with/
was prefixed with the route base path again, producing URLs like
.../docs/team-b/docs/faq.md. Absolute slugs are now used as-is. (#63) - Multiple
docsDirentries collapsed to the first: with
docsDir: ['docs', 'blog'], every page resolved to the first matching
section, mis-routing pages and leakingblogURLs intodocsoutput.
Sections now resolve per-file, routes are scoped per-section, and the new
blogDir/blogRouteBasePathoptions configure a blog alongside docs. (#67)
Documentation
- README restructured into a full
docs/site: installation, configuration,
output files, content cleaning, best practices, and per-feature guides. (#61) - Corrected the JSDoc default for
generateMarkdownFiles. (#62) - New "Validating the deployed output" section in best practices. (#66)
Thanks
This release exists because of its contributors. Thanks to everyone who
opened pull requests: adeelehsan,
AlexAdiaconitei,
anupamme, canuto,
deka0106, F-OBrien,
ilanazholobovsky,
kingsword09, Konkrad,
nicolasiscoding,
portdeveloper,
puehringer, scottamain,
smol-ninja, statico,
and svrnm.
Thanks to everyone who filed issues that shaped this release:
allxsmith, anvme,
benfoster, canuto,
critesjosh, ctauchen,
cyrusmith, dineshpinto,
emertechie, fflaten,
ilanazholobovsky,
johngrimes, manuelmeurer,
nicolasiscoding, PaulRBerg,
prdai, quangdusk,
Rajesh11082005, ratansen,
Rob-Purbrick, scottamain,
smol-ninja,
sujanmoi-kasm, thomhurst,
wparad, and yada.
If you reported a problem, tested a pre-release, or shared feedback along
the way, that work made 0.6.0 better. Thank you.
v0.5.1 — path & route resolution fixes
Bug-fix release for individual .md generation — path and route resolution.
Fixed
- Numeric frontmatter
slug/id/title— unquoted YAML numbers (e.g.slug: 2025) are now coerced to strings, matching how Docusaurus routes them, so the.mdis written at the correct route instead of a fallback filename. (#58) baseUrlapplied twice on disk — with a non-rootbaseUrl, files were nested one level too deep and their links 404'd; the baseUrl segment is now stripped before deriving the physical path. (#59)- Compound numeric prefixes — ordering prefixes are parsed like Docusaurus's
DefaultNumberPrefixParser(e.g.03--1.6.X→1.6.X), and version/date-like names such as7.0-fooare preserved. (#59) - Explicit
slug/idprecedence — an authoritative frontmatterslug/id(includingslug: "/") is consulted before the filename-tail heuristic, so a root page no longer loses its route to a coincidental match. (#59)
Thanks to @AlexAdiaconitei (#59) and @ratansen (#58).
v0.5.0 — multi-version llms.txt + @site partials
Added
- Multi-version output via a new
versionsoption. Generate a separate set of LLM files per documentation version, each written under its own subdirectory with links scoped to that version's routes. Accepts an explicit array of versions ({ name, label, docsDir, path, customLLMFiles, includeOrder }) or'auto'to detect them from Docusaurus docs versioning (versions.json+versioned_docs/). Omittingversionspreserves the existing single-root behavior. (#56)
Fixed
@sitealias partials are now resolved and inlined (previously the import was stripped but the JSX tag survived, dropping the partial's content). Partials in a/partials/directory are recognized alongside the_partialconvention, and a partial's ownimportlines are stripped before inlining so they don't leak into lists. (#55, closes #54)@siteimports resolve against the site directory (threadedsiteDir) rather thanprocess.cwd(). (#57)
v0.4.0
What's New
- Append
.mdto llms.txt link URLs — Per the llmstxt.org spec, links inllms.txtnow point to markdown versions of pages (e.g./docs/intro.mdinstead of/docs/intro/). (#38) - Fix import/export in descriptions —
.mdxfiles starting withimportorexportstatements no longer use those lines as page descriptions. (#39) - Added test coverage for import/export description extraction fix. (#40)
Breaking Change
addMdExtension defaults to true. All link URLs in generated llms.txt files will now have .md appended. To preserve the previous behavior, set addMdExtension: false in your plugin config.
Full Changelog: v0.3.1...v0.4.0
v0.3.1
Bug Fixes
- #31 — Doubled
docs/docs/paths whenrouteBasePath: '/'and docs live in a nesteddocs/subdirectory - #30 —
trailingSlash: truenot reflected in generated URLs
What Changed
Replaced the routeMap construction approach with suffix-based matching against Docusaurus's own routesPaths. This removes ~150 lines of production code (five edge-case helper functions) and makes URL resolution simpler and more correct across all common Docusaurus configurations.
Note:
pathTransformationis now only applied as a fallback when a file cannot be matched to a known Docusaurus route. In most configurations, you no longer need it.
Thanks to @scottamain for the fix!
v0.3.0 - Stability and Robustness Release
Highlights
This release focuses on stability, robustness, and addressing edge cases with 33 bug fixes across critical functionality, data integrity, path handling, and performance.
Critical Bug Fixes (GitHub Issues)
- #19 PluginOptions type compatibility with Docusaurus - Added index signature to resolve TypeScript errors
- #23 YAML encoding for special characters and emojis - Added proper YAML.stringify options
- #25 includeOrder pattern matching - Now matches against both site-relative and docs-relative paths
- #15 Numbered prefix handling - Uses Docusaurus resolved routes before manual prefix removal
Key Improvements
- Windows Compatibility: Path length validation, proper path normalization
- Large Site Support: Batch processing prevents OOM on sites with 1000+ pages
- Type Safety: Improved TypeScript types, proper error handling
- Input Validation: Comprehensive validation prevents crashes from invalid input
- Pattern Matching: Flexible pattern matching supports multiple path formats
- URL Handling: Robust URL construction with proper encoding and error handling
- Frontmatter Parsing: Handles special characters, emojis, and edge cases
Testing
- 300+ tests across 50 test files, all passing
- Comprehensive test coverage for all bug fixes
- Integration tests for plugin functionality
Breaking Changes
None. This release maintains backward compatibility with v0.2.x.
See CHANGELOG.md for complete details.
Update generation of individual markdown files
Update generation of individual markdown files
What's Changed
New Contributors
Full Changelog: v0.2.0...v0.2.1
v0.2.0 - Partials Support & Custom Root Content
🚀 New Features
Docusaurus Partials Support
- Full support for Docusaurus partial files (MDX files prefixed with underscore)
- Automatically excludes partial files (e.g.,
_shared.mdx) from being processed as standalone documents - Resolves and inlines partial content when imported in other documents
- Handles both default and named imports:
import Partial from './_partial.mdx' - Replaces JSX usage
<Partial />with the actual partial content
Custom Root Content
- New
rootContentoption for customizing the introductory content inllms.txt - New
fullRootContentoption for customizing the introductory content inllms-full.txt - Custom root content support for individual custom LLM files
- Follows llmstxt.org standard allowing markdown sections after title/description
- Enables project-specific context, technical specifications, and navigation hints
🔧 Improvements
URL Resolution
- Plugin now uses actual resolved URLs from Docusaurus routes instead of guessing paths
- Properly handles numbered prefixes in file names (e.g.,
1-page.md→/docs/page) - Uses Docusaurus's route data from the
postBuildlifecycle hook - Comprehensive route matching with fallbacks for backward compatibility
📚 Documentation
- Added comprehensive examples for all new features
- Updated README with usage guides and best practices
- Enhanced changelog with technical details
🧪 Testing
- Added test suites for partials support and custom root content
- All existing functionality continues to work as expected
- 100% backward compatibility maintained
Breaking Changes
None - this release is fully backward compatible.
Example Usage
// docusaurus.config.js
plugins: [
[
'docusaurus-plugin-llms',
{
rootContent: `Welcome to our comprehensive documentation.
This documentation covers:
- Installation and setup guides
- Complete API reference
- Best practices and tutorials
For support, visit https://example.com/support`,
customLLMFiles: [
{
filename: 'llms-api.txt',
includePatterns: ['api/**/*.md'],
fullContent: true,
rootContent: 'Complete API reference. Authentication required.'
}
]
}
]
]