Skip to main content

Template language

A Bigodin template is a string that produces an output when given a context. The context is a JSON-like value: numbers, strings, booleans, arrays, objects. The template references context fields, calls registered helpers, branches on conditions, and loops over arrays.

This section is a reference for the template-side syntax. For the host-side API (compile, parse, run, addHelper) see Library API; for the bundled block primitives (if, unless, with, each, return) see Block helpers.

Quick example

{{#if user.active}}
Welcome,
{{user.name}}! Your last 3 orders:
{{#each (slice user.orders 0 3)}}
-
{{@index}}.
{{this.product}}
({{this.total}})
{{/each}}
{{else}}
Account inactive.
{{/if}}

Topics

If you are coming from Mustache, also read Migrate from Mustache for a list of behavioral differences.