Configuration options
This page lists every option docusaurus-plugin-llms accepts, with its type and default. The plugin runs with no options; set these to change its defaults. To set the plugin up for the first time, see installation.
You pass options as the second element of the plugin tuple in docusaurus.config.js:
module.exports = {
plugins: [
[
'docusaurus-plugin-llms',
{
generateLLMsTxt: true,
docsDir: 'docs',
ignoreFiles: ['advanced/*', 'private/*'],
title: 'My Project Documentation',
description: 'Complete reference documentation for My Project',
},
],
],
};
Output files
These options control which files the plugin writes and what they're named.
| Option | Type | Default | Description |
|---|---|---|---|
generateLLMsTxt | boolean | true | Whether to generate the llms.txt links file. |
generateLLMsFullTxt | boolean | true | Whether to generate the llms-full.txt full-content file. |
llmsTxtFilename | string | 'llms.txt' | Custom file name for the links file. |
llmsFullTxtFilename | string | 'llms-full.txt' | Custom file name for the full-content file. |
generateMarkdownFiles | boolean | false | Generate an individual .md file per page and link to those from llms.txt in place of the original docs. |
preserveDirectoryStructure | boolean | true | Preserve the source directory structure in generated markdown files (for example docs/server/config.md). Only applies when generateMarkdownFiles is true. |
keepFrontMatter | string[] | none | Front matter keys to preserve in generated markdown files. Only applies when generateMarkdownFiles is true. |
Content sources
These options select which files the plugin reads and in what order.
| Option | Type | Default | Description |
|---|---|---|---|
docsDir | string | DocsSection[] | 'docs' | Documentation source. A string base directory, or an array of section objects for multi-instance setups. See Documentation sections. |
ignoreFiles | string[] | [] | Glob patterns for files to skip. |
includeBlog | boolean | false | Whether to include blog posts. See include blog posts. |
blogDir | string | 'blog' | Filesystem path to the blog content directory, relative to the site root. |
blogRouteBasePath | string | 'blog' | Docusaurus routeBasePath for the blog plugin, relative to the site baseUrl. Set this to match presets.blog.routeBasePath if you've customized it (for example 'news'). |
includeOrder | string[] | [] | Glob patterns controlling the order files are processed in. |
includeUnmatchedLast | boolean | true | Whether to append files that match no includeOrder pattern at the end. Set to false to make includeOrder a strict inclusion list. |
processingBatchSize | number | 100 | Number of documents per batch when assembling llms-full.txt. Sets how often verbose mode logs progress. See batch processing. |
Content and metadata
These options set the title, description, and inline content of the generated files.
| Option | Type | Default | Description |
|---|---|---|---|
title | string | Site title | Custom title used in generated files. |
description | string | Site tagline | Custom description used in generated files. |
version | string | undefined | Global version label stamped into all generated files. |
rootContent | string | Standard llmstxt.org blurb | Custom content inserted at the root of llms.txt, after the title and description and before the table of contents. |
fullRootContent | string | Standard llmstxt.org blurb | Custom content inserted at the root of llms-full.txt, after the title and description and before the content sections. |
Content cleaning
These options remove markup from the source Markdown before the plugin writes it.
| Option | Type | Default | Description |
|---|---|---|---|
excludeImports | boolean | false | Remove import statements from generated content. |
removeDuplicateHeadings | boolean | false | Remove a line that repeats the heading text directly below the heading. |
preserveComponents | string[] | [] | Component names whose tags and props the plugin keeps as written. See preserving component tags. |
URL construction
These options control the links the plugin emits.
| Option | Type | Default | Description |
|---|---|---|---|
addMdExtension | boolean | true | Append .md to link URLs in llms.txt, per the llmstxt.org spec. Only applies when generateMarkdownFiles is true. |
useRelativeUrls | boolean | false | Write links as paths from the site root (for example /docs/page.md). See relative links. |
rewriteImageUrls | boolean | false | Rewrite relative image references to absolute hashed build-output URLs so LLMs can resolve them. |
pathTransformation | object | undefined | Fallback path rewriting for URL construction. See Path transformation. |
The pathTransformation object accepts these fields:
| Field | Type | Default | Description |
|---|---|---|---|
ignorePaths | string[] | [] | Path segments to remove when constructing URLs. |
addPaths | string[] | [] | Path segments to prepend when constructing URLs, if not already present. |
Advanced
These options add extra files, split output by version, and control logging.
| Option | Type | Default | Description |
|---|---|---|---|
customLLMFiles | CustomLLMFile[] | [] | Additional LLM files for specific documentation sections. See Custom LLM files. |
versions | VersionConfig[] | 'auto' | undefined | Generate a version-scoped set of files per documentation version. 'auto' detects versions from Docusaurus docs versioning. See Versions. |
logLevel | 'quiet' | 'normal' | 'verbose' | 'normal' | Amount of build output the plugin prints. See Logging. |
warnOnIgnoredFiles | boolean | false | Whether to warn about files that are skipped because they have no extension or an unsupported one. |
Documentation sections
docsDir accepts either a string (a single base directory) or an array of DocsSection objects. Use the array form for multi-instance setups, so each section resolves against its own route base path and can carry its own heading in llms.txt.
Each section object has this shape:
| Field | Type | Required | Description |
|---|---|---|---|
path | string | yes | Filesystem path to the section, relative to the site directory (for example 'docs', 'api'). |
routeBasePath | string | yes | The Docusaurus routeBasePath the section is served under (for example 'docs', 'api'), relative to the site baseUrl. |
label | string | no | Heading for the section in links files such as llms.txt. Defaults to the section's path. |
Section headings appear when docsDir lists two or more sections. llms-full.txt has no section headings.
When docsDir is a string, the plugin treats it as a single section and matches its files against all of the site's routes.
Custom LLM files
Each entry in customLLMFiles is a CustomLLMFile object with these fields:
| Field | Type | Required | Description |
|---|---|---|---|
filename | string | yes | Name of the output file (for example 'llms-python.txt'). |
includePatterns | string[] | yes | Glob patterns for files to include. |
fullContent | boolean | yes | true for full content like llms-full.txt, false for links only like llms.txt. |
title | string | no | Custom title for this file. Defaults to the site title. |
description | string | no | Custom description for this file. Defaults to the site description. |
ignorePatterns | string[] | no | Additional patterns to exclude, combined with the global ignoreFiles. |
orderPatterns | string[] | no | Order patterns for this file, like includeOrder. |
includeUnmatchedLast | boolean | no | Whether to append files that match no orderPatterns entry at the end. Defaults to true. |
version | string | no | Version label for this file, overriding the global version. |
rootContent | string | no | Custom content inserted at the root of this file, after the title and description. |
Versions
Set versions to publish a separate set of LLM files per documentation version, each written under its own subdirectory with links scoped to that version's routes. Provide an explicit array of VersionConfig objects, or 'auto' to detect versions, their routes, and the last version from the Docusaurus docs plugin config and versions.json. Any field left unset on a version falls back to the matching top-level option.
Each VersionConfig entry accepts:
| Field | Type | Default | Description |
|---|---|---|---|
name | string | required | Version identifier (for example 'nightly', 'stable', '0.0.1'). |
label | string | name | Label written into the Version: line of generated files. With versions: 'auto', see automatic detection. |
docsDir | string | DocsSection[] | top-level docsDir | Source docs directory or sections for this version. |
path | string | name | Output subdirectory and route prefix. Use '' for the site root. |
routePrefix | string | path | Route prefix the version's links resolve under. Use '' when the sections' routeBasePath holds it. See multi-version output. |
customLLMFiles | CustomLLMFile[] | top-level value | Per-version custom LLM files. |
includeOrder | string[] | top-level value | Per-version include order. |
Path transformation
The plugin resolves URLs by matching file paths against the routes Docusaurus built. pathTransformation applies only to files that match no known route, so most sites don't need it. ignorePaths removes segments from the constructed URL and addPaths adds them:
pathTransformation: {
ignorePaths: ['docs'],
addPaths: ['api'],
}
With docsDir: 'docs' and that config, the file docs/manual/decorators.md resolves to https://example.com/api/manual/decorators. For each field on its own, see path transformation.
Logging
The logLevel option controls how much the plugin prints during the build. It takes these values:
'quiet': prints errors only. Use it to keep CI logs short.'normal'(default): shows standard progress messages and warnings.'verbose': shows file-by-file processing detail. Use it for debugging.
Set the level alongside your other options:
{
logLevel: 'verbose',
}
In 'normal' mode, output looks like this:
[docusaurus-plugin-llms] Generating LLM-friendly documentation...
[docusaurus-plugin-llms] Generated: /path/to/build/llms.txt
[docusaurus-plugin-llms] Generated: /path/to/build/llms-full.txt
[docusaurus-plugin-llms] No custom LLM files configured. Skipping.
[docusaurus-plugin-llms] Stats: 42 documents processed
In 'quiet' mode, only errors appear:
[docusaurus-plugin-llms] ERROR: Error generating LLM documentation: ...