Output

Here is a simple example of Output:

Hello {{name}}
Hello {{user.name}}
Hello {{ 'tobi' }}

Advanced output: Filters

Output markup takes filters. Filters are simple methods. The first parameter
is always the output of the left side of the filter. The return value of the
filter will be the new left value when the next filter is run. When there are
no more filters, the template will receive the resulting string.

For loops

When iterating a hash, item[0] contains the key, and item[1] contains the value:

{% for item in hash %}{{ item[0] }}: {{ item[1] }}{% endfor %}

During every for loop, the following helper variables are available for extra
styling needs:

forloop.length # => length of the entire for loop
forloop.index # => index of the current iteration
forloop.index0 # => index of the current iteration (zero based)
forloop.rindex # => how many items are still left?
forloop.rindex0 # => how many items are still left? (zero based)
forloop.first # => is this the first iteration?
forloop.last # => is this the last iteration?

There are several attributes you can use to influence which items you receive in
your loop

limit:int lets you restrict how many items you get.
offset:int lets you start the collection with the nth item.

If you want to combine a number of strings into a single string and save it to
a variable, you can do that with the capture tag. This tag is a block which
"captures" whatever is rendered inside it, then assigns the captured value to
the given variable instead of rendering it to the screen.