Skip to main content

Template engines

A template's body-file extension selects its engine. When a directory holds more than one candidate body file, the engine is chosen in a fixed priority order — the first match wins:

PriorityEngineBody fileNotes
1 (highest)Mustachetemplate.mustacheLogic-light, safest, simplest.
2Handlebarstemplate.handlebarsHelpers + partials; the recommended default.
3Go html/templatetemplate.tmplFull control flow, context-aware auto-escaping.
4 (lowest)Static HTMLtemplate.htmlServed verbatim; dynamism via client-side JS.

Two directory types are loaded outside this order (a directory is one of these or a body engine, never both):

  • Raw PDF — a raw.pdf returned as-is; a building block for compositions.
  • Remote HTTP — a template.http.hbs whose fetched response body becomes the output.

See Template structure for how these fit into a template directory.