Registries

Generate sitemap.xml, llms.txt, and other files from page metadata.

Registries

Registries are auto-generated files (sitemap, feeds, indexes) built from page metadata. Pages opt in by listing registry names in their register: front matter. Registry templates in lazysite/templates/registries/ define the output format.

sitemap.xml and llms.txt list every public page (from 0.16.8). A page with no register: key is in both; a page with one keeps what it says, so a page that registers only for a feed is in neither. The two are built from one page set and always list the same pages: a page registered for either of them is in both. Never listed, whatever they register: a protected or draft page, a page copy, an api: or raw: page, a page with search: false, a redirect, a starter demonstration page and the engine's sign-in and error pages. Nor does the bare host list a folder that looks like another site's content - one under sites/, or one holding its own lazysite.conf - unless it is declared as a domain's content_root; lazysite check names such a folder, since the bare host still serves it. llms.txt also carries the site's organisation entry, and llms_txt: off in lazysite.conf turns it off. See Structured data for search.

Syntax

In page front matter:

---
title: My Page
register:
  - sitemap.xml
  - llms.txt
---

How it works

When any page is rendered, lazysite checks if any registry output file is missing or older than the registry TTL (14400 seconds / 4 hours by default). If so, it scans all .md files under the docroot, collects pages with register: front matter, and renders each registry template with the matching pages.

Registry templates

Templates are TT files in lazysite/templates/registries/. The template filename (minus .tt) becomes the output filename in the docroot. For example, sitemap.xml.tt generates sitemap.xml.

Available variables in registry templates:

Adding a new registry

Create a .tt file in lazysite/templates/registries/:

[% FOREACH page IN pages %]
[% page.url %] - [% page.title %]
[% END %]

Then add the registry name (filename without .tt) to pages that should be included.

Example

---
title: About Us
register:
  - sitemap.xml
  - llms.txt
  - feed.rss
---

Notes