FamilyHQ Sign out Sign in

API mode

Output pure TT content with no Markdown conversion and no layout.

API mode

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.

Syntax

---
title: Status API
api: true
---
{"status": "ok", "site": "[% site_name %]"}

Default content type

API mode serves application/json; charset=utf-8 by default. Override it with content_type::

---
api: true
content_type: text/plain; charset=utf-8
---

Example

---
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 %]

Notes