Skip to content

Writing Templates

A kBars template is text with tags in it — {{ name }}, {{#if …}}, {{> partial }}, and so on — that get replaced or expanded when the template is rendered against a context: a JSON- or YAML-shaped bag of data (an object with named fields, possibly nested, possibly containing lists).

Hello {{ name }}!

Rendered against a context where name is "Alice", this produces:

Hello Alice!

kBars mixes syntax you may already know from Mustache, Handlebars, and Liquid — see Coming from Handlebars, Mustache, or Liquid if one of those is familiar. Otherwise, start with Template Basics and work through the pages below in order; each builds on the last.

Where to next