-
Notifications
You must be signed in to change notification settings - Fork 84
/
sample_template.txt
38 lines (24 loc) · 1.42 KB
/
sample_template.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{{ hello }}
It's currently {% now | date_format: "dd MMM yyyy 'at' HH:mm:ss" %}
Nested variable: {{ foo.bar }}
{% for dude in guys %}
Current dude is {{ dude | uppercase }}...{% if dude equalsString "matt" %} AWESOME!{% /if %}
{% if currentLoop.currentIndex == 0 %}
(the best!) {% comment %} Should only happen for Matt {% /comment %}
{% for 1 to 5 %}*{% /for %}
{% /if %}
{% /for %}
Last of the {{ guys.@count }} guys was {{ guys.@lastObject | capitalized }}
Markers look like {{ engine.delimiters.markerStart }} this {{ engine.delimiters.markerEnd }}
Variables look like {{ engine.delimiters.expressionStart }} this {{ engine.delimiters.expressionEnd }}
Filter delimiter is {{ engine.delimiters.filter }}
We also know about {{ YES }} and {{ NO }} or {{ true }} and {{ false }}
Is 1 less than 2? {% if 1 < 2 %} Yes! {% else %} No? {% /if %}
Is 1 less than -2? {% if 1 < -2 %} Yes! {% else %} No? {% /if %}
Is 0 less than 5? {% if 0 < 5 %} Yes! {% else %} No? {% /if %}
Is 0 less than -8908095? {% if 0 < -8908095 %} Yes! {% else %} No? {% /if %}
Is -1289 less than -8908095? {% if -1289 < -8908095 %} Yes! {% else %} No? {% /if %}
{% literal %}This text won't be {% now %} interpreted.{% /literal %}
{% for 1 to 5 %}{{ currentLoop.currentIndex }}{%if currentLoop.currentIndex % 2%}[ODD] {%else%}[EVEN] {%/if%}{% /for %}
{% for 1 to 5 reversed %}{{ currentLoop.currentIndex }}{% cycle "[odd] " "[even] " %}{% /for %}
And we're done.