Skip to content

Search tags, filters, functions and guides.

Language / Values

Language

Values

The types templates work with, and how they print.

Kiln works with ordinary JavaScript values. Your data goes into a template as it is, with no conversion.

Types

KilnJavaScript
nullnull or undefined. Kiln treats them the same
booleantrue or false
numberA number. There is no separate integer type
stringA string
arrayAn Array
hashA plain object, or a Map with string keys
setA Set
dateA Date
markupA string marked safe to output. See Escaping
objectA class instance that opts in. See Safe markup and classes

True and false

Conditions such as if treat these values as false: null, false, 0, NaN, "", an empty array, an empty hash, and an empty set or map. Everything else is true, including "0" and " ".

page.kiln
{% if tags %}Has tags{% else %}No tags{% endif %}
{% if title %}Has a title{% endif %}
Output
No tags
Has a title

Printing values

When you output a value, Kiln turns it into a string:

ValueOutput
nullNothing
booleantrue or false
numberThe number, as JavaScript writes it
stringThe string, escaped
dateAn ISO 8601 date, such as 2026-10-15T09:30:00.000Z
array, hash, setAn error. Use join, json or a loop

Printing an array is an error rather than a silent "[object Object]", so mistakes show up straight away. Use json to print data for debugging.

Empty values

Some features check whether a value is empty rather than false. A value is empty if it is null, false, "", an empty array, an empty hash, or an empty set or map. Unlike false values, 0 is not empty.

page.kiln
{{ stock|default("Unknown") }}
{{ name|default("Anonymous") }}
Output
0
Anonymous

The default filter and the empty test use this rule.