Guides · Hugo

llms.txt for Hugo

Anything in static/ is copied to the published root unchanged; that is where llms.txt goes.

Where the file lives

  1. Create static/llms.txt in the project (not in the theme's static folder, and not in assets/, which is for pipeline-processed files). On build it is copied to public/llms.txt and deployed with the rest of the site.
  2. If your site is published under a sub-path (baseURL like https://example.com/blog/), the file lands at /blog/llms.txt. The file must be at the domain root, so serve it from the root site or add it there separately.

Serving it as text

  • Hugo does not set content types; the host does. GitHub Pages, Netlify, Cloudflare Pages and most static hosts serve .txt as text/plain.

The Hugo pitfall: Sub-path sites and theme folders

A file in themes/<theme>/static/ is only copied if that theme is active; keep the file in the project's own static/ folder so a theme switch cannot drop it.

A baseURL with a path puts the file under that path, where crawlers will not look. /llms.txt means the root of the host.

Check it

After deploy, request https://your-domain/llms.txt: 200, text/plain, and the same bytes as static/llms.txt.

What goes in the file, section by section, is in the knowledge base. The validator checks 14 rules and shows every deduction.