Mustache

Mustache is the simplest engine and has the highest priority: if a template directory contains template.mustache, it is used.

<h1>Invoice {{number}}</h1>
<ul>
  {{#items}}
    <li>{{name}} — {{price}}</li>
  {{/items}}
</ul>
{{^items}}<p>No items.</p>{{/items}}

Characteristics

  • Logic-light: variables, sections ({{#x}}…{{/x}}), inverted sections ({{^x}}), and partials. No custom helpers.
  • Missing variables are an error — a reference to a field absent from the data fails the render, catching typos and missing data early.
  • Values are HTML-escaped by default; {{{triple}}} emits raw HTML (avoid with untrusted data).
  • Supports partials ({{> name}}).

Use Mustache when your template is mostly static with straightforward substitution and you want the safest, simplest option. For conditionals with comparisons, helpers, or date formatting, use Handlebars or Go templates.