1
0
Fork 0

Jinja: Forbid stripping newlines

This creates a bit prettier theme output. When newlines from ends are
stripped, constructions like
```
<header>
{% include "header.html" %}
</header>
```
end compiled with the ending tag at last line of the include

I think it is a bit shame that Pelican does not have any method to
configure Jinja from the theme itself, since this is more theme-related
than content-related.
pub/python-goto
LEdoian 4 years ago
parent 8092349c14
commit d0f2b071a9

@ -13,6 +13,14 @@ RELATIVE_URLS = True
PATH = 'content' PATH = 'content'
THEME = 'test-theme' THEME = 'test-theme'
JINJA_ENVIRONMENT = {
# The default:
'trim_blocks': True,
'lstrip_blocks': True,
# Custom
'keep_trailing_newline': True,
}
TIMEZONE = 'Europe/Prague' TIMEZONE = 'Europe/Prague'

Loading…
Cancel
Save