Guides · Docusaurus
llms.txt for Docusaurus
Files in static/ are copied to the build root and respect baseUrl, which is the thing to watch.
Where the file lives
- Create static/llms.txt in the site folder. The build copies it to build/llms.txt, alongside index.html.
- If docusaurus.config sets baseUrl to something other than '/', the file is published under that base (for example /docs/llms.txt). Crawlers request the domain root, so a docs site under a sub-path needs the file served at the root by the host.
- Community plugins can generate an llms.txt from your docs on each build; if you use one, do not also keep a hand-written static/llms.txt, or the two will race for the same path.
Serving it as text
- The host sets the content type; .txt is text/plain on the usual static hosts. Docusaurus itself adds nothing.
The Docusaurus pitfall: baseUrl
This is the one that catches docs sites: the file builds fine, deploys fine, and sits at /docs/llms.txt where nothing looks for it. Check the final URL, not the build folder.
Check it
Request https://your-domain/llms.txt (no path) and expect 200 with text/plain.
What goes in the file, section by section, is in the knowledge base. The validator checks 14 rules and shows every deduction.