Skip to content

llmsPlugin

Writes llms.txt, llms-full.txt, and a Markdown copy of every page next to its HTML, for tools that read documentation as text.

theme.llmsPlugin({ siteUrl: "https://example.com", title: "My Project", summary: "One line about it." });

Options

OptionTypeDefaultRole
siteUrlstringAbsolute URL of the site. Without it nothing is written.
titlestring"Documentation"Heading of both files.
summarystringOne line quoted under the heading.

Output

FileContent
llms.txtOne link per page, grouped by top-level folder, with the page’s first paragraph as description.
llms-full.txtEvery page inlined, separated by ---, each followed by its source URL.
<route>/index.mdThe page’s Markdown, front matter and leading HTML comments removed.

Pages are ordered by depth, then path. A page’s title is its first # heading, headings in llms-full.txt are demoted one level under it. ~/ and @/ links are rewritten to absolute URLs. Pages dropped from the build with publish: false stay out.

Example

llms.txt
# My Project
> One line about it.
Every link below points to the page's Markdown source.
## Home
- [Home](https://example.com/index.md): The first paragraph of index.md.
## Guides
- [Setup](https://example.com/guides/setup/index.md): The first paragraph of setup.md.

Link the files from the site so they can be found:

Machine readable: [llms.txt](@/llms.txt), [llms-full.txt](@/llms-full.txt)

Notes

  • Runs after writeFilesPlugin, in production.
  • analyzeOutputPlugin({ deleteUnused: true }) removes files nothing links to, exclude llms.txt, llms-full.txt, and **/*.md.