Page content and view templates are processed by Template Toolkit (TT). Variables come from three sources: site-wide configuration, per-page definitions, and automatic page metadata.
Site variables (from lazysite.conf):
site_name: My Site
site_url: ${REQUEST_SCHEME}://${SERVER_NAME}
footer_text: Copyright 2024
Per-page variables (from front matter tt_page_var:):
---
tt_page_var:
features: scan:/docs/features/*.md sort=title asc
version: url:https://example.com/version.txt
label: Custom Label
---
Automatic variables (always available):
page_title - from front matter title:page_subtitle - from front matter subtitle:page_modified - file mtime formatted as "1 January 2024"page_modified_iso - file mtime as "2024-01-01"content - rendered page body (available in the view template)nav - navigation array from nav.confquery - query parameter hash (when query_params: is declared)Literal value:
my_var: some text
Environment variable interpolation (allowlisted variables only):
site_url: ${REQUEST_SCHEME}://${SERVER_NAME}
Allowlisted variables: SERVER_NAME, SERVER_PORT, REQUEST_SCHEME,
HTTPS, REQUEST_URI, REDIRECT_URL, DOCUMENT_ROOT, SERVER_ADMIN.
Remote URL fetch:
latest: url:https://example.com/data.txt
Directory scan:
posts: scan:/blog/*.md sort=date desc
---
title: Dashboard
tt_page_var:
posts: scan:/blog/*.md sort=date desc
motto: Live free or die
---
## [% motto %]
[% FOREACH post IN posts %]
- [[% post.title %]]([% post.url %]) ([% post.date %])
[% END %]
<pre><code> and inline <code>) are protected from
TT processing - TT directives inside code blocks are preserved as
literal texttitle:, subtitle:,
etc.) are stripped for security - [% and %] sequences are removedABSOLUTE => 0 to prevent file access
from within page content