File: whitespace_control.tpl

package info (click to toggle)
golang-github-flosch-pongo2.v4 4.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, trixie
  • size: 860 kB
  • sloc: makefile: 3
file content (33 lines) | stat: -rw-r--r-- 562 bytes parent folder | download | duplicates (2)
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
Standard whitespace control:
{% if true %}
Standard whitespace control
{% endif %}

Full Trim whitespace control:
{% if true -%}
Full Trim whitespace control
{%- endif %}

Useful with logic:
{%- if false %}
1st choice
{%- elif false %}
2nd choice
{%- elif true %}
3rd choice
{%- endif %}

Cycle without whitespace control:
{% for i in simple.multiple_item_list %}
{{ i }}
{% endfor %}

Cycle with whitespace control:
{% for i in simple.multiple_item_list %}
{{- i }}
{% endfor %}

Trim everything:
{% for i in simple.multiple_item_list -%}
{{ i }}
{%- endfor %}