Skip to main content

Configuration options

This page is the full reference for every option docusaurus-plugin-llms accepts. If you're setting the plugin up for the first time, start with installation; the plugin works with zero config, so you only need the options below when you want to change its defaults.

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.

OptionTypeDefaultDescription
generateLLMsTxtbooleantrueWhether to generate the llms.txt links file.
generateLLMsFullTxtbooleantrueWhether to generate the llms-full.txt full-content file.
llmsTxtFilenamestring'llms.txt'Custom file name for the links file.
llmsFullTxtFilenamestring'llms-full.txt'Custom file name for the full-content file.
generateMarkdownFilesbooleanfalseGenerate an individual .md file per page and link to those from llms.txt in place of the original docs.
preserveDirectoryStructurebooleantruePreserve the source directory structure in generated markdown files (for example docs/server/config.md). Only applies when generateMarkdownFiles is true.
keepFrontMatterstring[]noneFront 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.

OptionTypeDefaultDescription
docsDirstring | DocsSection[]'docs'Documentation source. A string base directory, or an array of section objects for multi-instance setups. See Documentation sections.
ignoreFilesstring[][]Glob patterns for files to skip.
includeBlogbooleanfalseWhether to include blog content.
blogDirstring'blog'Filesystem path to the blog content directory, relative to the site root.
blogRouteBasePathstring'blog'Docusaurus routeBasePath for the blog plugin. Set this to match presets.blog.routeBasePath if you've customized it (for example 'news').
includeOrderstring[][]Glob patterns controlling the order files are processed in.
includeUnmatchedLastbooleantrueWhether to append files that match no includeOrder pattern at the end. Set to false to make includeOrder a strict inclusion list.
processingBatchSizenumber100Batch size for processing large document sets, to bound memory use on big sites.

Content and metadata

These options set the title, description, and inline content of the generated files.

OptionTypeDefaultDescription
titlestringSite titleCustom title used in generated files.
descriptionstringSite taglineCustom description used in generated files.
versionstringundefinedGlobal version label stamped into all generated files.
rootContentstringStandard llmstxt.org blurbCustom content inserted at the root of llms.txt, after the title and description and before the table of contents.
fullRootContentstringStandard llmstxt.org blurbCustom content inserted at the root of llms-full.txt, after the title and description and before the content sections.

Content cleaning

These options strip noise from the source markdown before it's written.

OptionTypeDefaultDescription
excludeImportsbooleanfalseRemove import statements from generated content.
removeDuplicateHeadingsbooleanfalseRemove content that just repeats the heading text immediately below it.
preserveComponentsstring[][]Component names whose JSX tags pass through untouched, exempt from stripping. See preserving component tags.

URL construction

These options control the links the plugin emits.

OptionTypeDefaultDescription
addMdExtensionbooleantrueAppend .md to link URLs in llms.txt, per the llmstxt.org spec.
useRelativeUrlsbooleanfalseEmit links relative to the site origin (for example /docs/page.md). Useful for subpath deployments where the site url can't be pinned.
rewriteImageUrlsbooleanfalseRewrite relative image references to absolute hashed build-output URLs so LLMs can resolve them.
pathTransformationobjectundefinedFallback path rewriting for URL construction. See Path transformation.

The pathTransformation object accepts these fields:

FieldTypeDefaultDescription
ignorePathsstring[][]Path segments to remove when constructing URLs.
addPathsstring[][]Path segments to prepend when constructing URLs, if not already present.

Advanced

These options handle multi-file, multi-version, and diagnostic behavior.

OptionTypeDefaultDescription
customLLMFilesCustomLLMFile[][]Additional LLM files for specific documentation sections. See Custom LLM files.
versionsVersionConfig[] | 'auto'undefinedGenerate 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.
warnOnIgnoredFilesbooleanfalseWhether 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:

FieldTypeRequiredDescription
pathstringyesFilesystem path to the section, relative to the site directory (for example 'docs', 'api').
routeBasePathstringyesThe Docusaurus routeBasePath the section is served under (for example 'docs', 'api').
labelstringnoOptional heading shown for the section in llms.txt.

When docsDir is a string, it's treated as a single section whose routeBasePath matches the directory name.

Custom LLM files

Each entry in customLLMFiles is a CustomLLMFile object with these fields:

FieldTypeRequiredDescription
filenamestringyesName of the output file (for example 'llms-python.txt').
includePatternsstring[]yesGlob patterns for files to include.
fullContentbooleanyestrue for full content like llms-full.txt, false for links only like llms.txt.
titlestringnoCustom title for this file. Defaults to the site title.
descriptionstringnoCustom description for this file. Defaults to the site description.
ignorePatternsstring[]noAdditional patterns to exclude, combined with the global ignoreFiles.
orderPatternsstring[]noOrder patterns for this file, like includeOrder.
includeUnmatchedLastbooleannoWhether to append unmatched files last. Defaults to false.
versionstringnoVersion label for this file, overriding the global version.
rootContentstringnoCustom 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 from Docusaurus docs versioning (versions.json plus versioned_docs/). Any field left unset on a version falls back to the matching top-level option.

Each VersionConfig entry accepts:

FieldTypeDefaultDescription
namestringrequiredVersion identifier (for example 'nightly', 'stable', '0.0.1').
labelstringnameLabel written into the Version: line of generated files.
docsDirstring | DocsSection[]top-level docsDirSource docs directory or sections for this version.
pathstringnameOutput subdirectory and route prefix. Use '' for the site root.
customLLMFilesCustomLLMFile[]top-level valuePer-version custom LLM files.
includeOrderstring[]top-level valuePer-version include order.

Path transformation

The plugin resolves URLs by matching file paths against Docusaurus's actual routes, so pathTransformation is only applied as a fallback when a file can't be matched to a known route. In most setups you don't need it. When you do, ignorePaths strips segments from the constructed URL and addPaths prepends them:

pathTransformation: {
ignorePaths: ['docs'],
addPaths: ['api'],
}

With that config, the file /content/docs/manual/decorators.md resolves to https://example.com/api/manual/decorators.

Logging

The logLevel option controls how much the plugin prints during the build. It takes one of three values:

  • 'quiet': suppresses all output except errors. Use it for clean CI/CD builds.
  • '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/llms.txt
[docusaurus-plugin-llms] Generated: /path/to/llms-full.txt
[docusaurus-plugin-llms] Stats: 42 total available documents processed

In 'quiet' mode, only errors appear:

[docusaurus-plugin-llms] ERROR: Error generating LLM documentation: ...