This requirement is often used, such as in if-elseif or for loops, it will also output the blank lines of the if-else label part. If you want to clean up these blank lines, you can use them in front of or after the label.-
to implement filtering.
Sample code
{%- if false %}
1st choice
{%- elif false %}
2nd choice
{%- elif true %}
3rd choice
{%- endif %}
正常下
{% for item in archives %}
{{ item.Id }}
{% endfor %}
紧凑:
{% for item in archives %}
{{- item.Id }}
{% endfor %}
不带换行
{% for item in archives -%}
{{ item.Id }}
{%- endfor %}