llms.txt is a Markdown file at the root of a site, /llms.txt, that lists the pages of the site, with a link to a Markdown copy of each page. AI tools read it to find your pages. This site has one: see /llms.txt.
First, make a Markdown copy of each page. See Markdown copies.
Write llms.txt
content/llms.txt.hbs is an output file: it writes /llms.txt. Output files render after every page, so each entry of $pages has alternates, with the URL of its Markdown copy:
# {{{ $site.title }}}
> {{{ $site.description }}}
## Pages
{{#each $pages.filter(page => page.alternates['text/markdown']) as page}}
- [{{{ page.title }}}]({{{ $utils.url.abs(page.alternates['text/markdown']) }}}): {{{ page.summary }}}{{/each}}This writes:
# My site
> Notes about "static" sites & bongo.
## Pages
- [About](https://example.com/about.md): Who we are & why.
- [Config](https://example.com/config.md): The config file.Three details
- Use
{{{ }}}, not{{ }}.{{ }}escapes&,<, and"for HTML, and a text file must keep them. - Start each line of a loop just after a tag, as in
{{#each …}}and then- […. tempura removes the line break just before each tag. See Whitespace. $utils.url.abs()makes each link a full URL, so that the file works when a tool reads it from somewhere else.
Group the list
To group the list, loop over your own groups. This site groups its pages by the group of their frontmatter, as its sidebar does: see its llms.txt.hbs.
Check it
bongo devserves/llms.txt, and renders it again after each change to a page.bongo buildwritespublic/llms.txt.