Setting api: true in front matter treats the page body as pure
Template Toolkit content. No Markdown pipeline runs and no view
template is applied. The output is trimmed of leading and trailing
whitespace for clean JSON or other structured output.
---
title: Status API
api: true
---
{"status": "ok", "site": "[% site_name %]"}
API mode serves application/json; charset=utf-8 by default. Override
it with content_type::
---
api: true
content_type: text/plain; charset=utf-8
---
---
title: Pages API
api: true
tt_page_var:
all_pages: scan:/blog/*.md sort=date desc
---
[{"title": "[% p.title %]", "url": "[% p.url %]"}
[% UNLESS loop.last %],[% END %]
[% END %]
s/^\s+|\s+$//g) for clean structured outputlazysite.conf and tt_page_var are availablelazysite/cache/ct/ttl: to control both server-side cache lifetime and the browser
Cache-Control: public, max-age=TTL header