llms.txt in Docusaurus
Docs sites are prime candidates for llms.txt. In Docusaurus it is one file in static/.
Last updated:
Where the file goes
Docusaurus copies everything in the static/ directory to the root of the built site.
A file at static/llms.txt is served at /llms.txt. Because Docusaurus
powers documentation, an llms.txt that maps your key docs pages is especially valuable
to AI assistants.
Keep the file short and deliberate. Point assistants to overview pages, API references,
versioned docs, changelog and support policy rather than every sidebar entry. If the docs use a
non-root baseUrl, verify both the built path and the public URL before announcing
the file.
Method: the static/ folder
- Add the file:
touch static/llms.txt - List your most useful docs pages (see the how-to guide):
# Your Project Docs
> Documentation for Your Project: guides, API reference, and tutorials.
## Guides
- [Getting started](https://yourdomain.com/docs/intro): installation and first steps.
- [Configuration](https://yourdomain.com/docs/config): all options explained.
## Reference
- [API reference](https://yourdomain.com/docs/api): full endpoint catalog.
- Build and deploy:
npm run build.
Watch out for baseUrl
Verifying the setup
curl -sI https://yourdomain.com/llms.txt | grep -i content-type
# expect: content-type: text/plain
Hosting docs on GitHub Pages? See the GitHub Pages guide for
the root-path caveat. For a full-content variant, add
llms-full.txt, then check both with the
validator.