@@ -10,28 +10,29 @@ similar to [Jinja2](jinjadoc) and [Django](djangodoc) templates, and also to [As
10
10
11
11
We want our rendered output to have as little unnecessary whitespace as
12
12
possible, so that pages load quickly. To achieve that we use Tera's
13
- [ whitespace control] features. At the end of most lines, we put an empty comment
14
- tag with the whitespace control characters: ` {#- -#} ` . This causes all
15
- whitespace between the end of the line and the beginning of the next, including
16
- indentation, to be omitted on render. Sometimes we want to preserve a single
17
- space. In those cases we put the space at the end of the line, followed by
18
- ` {# -#} ` , which is a directive to remove following whitespace but not preceding.
19
- We also use the whitespace control characters in most instances of tags with
20
- control flow, for example ` {%- if foo -%} ` .
13
+ [ whitespace control] features. By default, whitespace characters are removed
14
+ around jinja tags (` {% %} ` for example). At the end of most lines, we put an
15
+ empty comment tag: ` {# #} ` . This causes all whitespace between the end of the
16
+ line and the beginning of the next, including indentation, to be omitted on
17
+ render. Sometimes we want to preserve a single space. In those cases we put the
18
+ space at the end of the line, followed by ` {#+ #} ` , which is a directive to
19
+ remove following whitespace but not preceding. We also use the whitespace
20
+ control characters in most instances of tags with control flow, for example
21
+ ` {% if foo %} ` .
21
22
22
23
[ whitespace control ] : https://tera.netlify.app/docs/#whitespace-control
23
24
24
25
We want our templates to be readable, so we use indentation and newlines
25
- liberally. We indent by four spaces after opening an HTML tag _ or_ a Tera
26
+ liberally. We indent by four spaces after opening an HTML tag _ or_ a Jinja
26
27
tag. In most cases an HTML tag should be followed by a newline, but if the
27
28
tag has simple contents and fits with its close tag on a single line, the
28
29
contents don't necessarily need a new line.
29
30
30
- Tera templates support quite sophisticated control flow. To keep our templates
31
+ Askama templates support quite sophisticated control flow. To keep our templates
31
32
simple and understandable, we use only a subset: ` if ` and ` for ` . In particular
32
- we avoid [ assignments in the template logic] ( assignments ) and [ Tera
33
+ we avoid [ assignments in the template logic] ( assignments ) and [ Askama
33
34
macros] ( macros ) . This also may make things easier if we switch to a different
34
35
Jinja-style template system, like Askama, in the future.
35
36
36
- [ assignments ] : https://tera.netlify.app/docs/ #assignments
37
- [ macros ] : https://tera.netlify.app/docs/ #macros
37
+ [ assignments ] : https://djc.github.io/askama/template_syntax.html #assignments
38
+ [ macros ] : https://djc.github.io/askama/template_syntax.html #macros
0 commit comments