Reference, 1 of 3

Templating variables

The full set of variables you can put into a header, footer, or TOC row template.

Syntax

Templates use Mustache. Wrap a variable name in {{…}} to insert it. For conditional sections, use {{#name}}…{{/name}} (renders when truthy) or {{^name}}…{{/name}} (renders when falsy).

Anything that isn't a variable renders verbatim, so you can mix in literal text: Page {{page}} of {{pages}}.

All variables

Pagination

  • {{page}} Current page number
  • {{pages}} Total page count
  • {{section}} Current entry index (1-based)
  • {{sections}} Total entry count

Project

  • {{project}} Project / root folder name

File

  • {{file}} File name (e.g. state.svelte.ts)
  • {{path}} Full relative path
  • {{ext}} File extension
  • {{title}} Custom title or file name

Date

  • {{date.iso}} 2026-05-03
  • {{date.long}} May 3, 2026
  • {{date.short}} Locale-default short
  • {{date.year}} 2026
  • {{date.month}} 05
  • {{date.day}} 03
  • {{date.weekday}} Sunday

Time

  • {{time.iso}} 22:13:00
  • {{time.short}} 22:13
  • {{time.hour}} 22
  • {{time.minute}} 13

Conditionals (Mustache sections)

  • {{#isCover}} {{#isCover}}…{{/isCover}}
  • {{#isToc}} {{#isToc}}…{{/isToc}}
  • {{#isFile}} {{#isFile}}…{{/isFile}}
  • {{#isFirstPageOfFile}} Show only on first sheet of each file
  • {{#isFirstPageOfDoc}} Show only on the very first page
  • {{#isLastPageOfDoc}} Show only on the last page
  • {{^isCover}} Inverted: hide on cover

Examples

A few patterns worth stealing:

{{#isFile}}{{title}}{{/isFile}}

Show the section title only on file pages, leaving the cover and TOC unlabelled.

{{page}} / {{pages}}

"3 / 12" page numbering.

{{project}} — {{date.long}}

Project name and a fully written date in the top corner.

{{^isFirstPageOfFile}}{{title}} (continued){{/isFirstPageOfFile}}

Add a "(continued)" suffix on the second sheet onwards of any file that spans multiple pages.

Autocomplete