I used the tool [htmlbeautify][1] like so
htmlbeautifier -t 4 -b 1 pelican/themes/simple/templates/*.html
htmlbeautifier -t 4 -b 1 pelican/themes/notmyidea/templates/*.html
and then manually adjusted the output. The final result follows the
following rules.
- 4-space indentation
- Multiline nested tags like
<tag1><tag2>
... nested content ...
</tag2></tag1>
are broken up into
<tag1>
<tag2>
... nested content ...
</tag2>
</tag1>
but if everything is on one like this
<tag1><tag2>... nested content ...</tag2></tag1>
it's OK.
- Treat new blocks like tags when indenting. E.g.
{% if cond %}
<p>hello</p>
{% endif %}
However, observe the following exceptions:
- Don't indent inside a {% block %}, {% macro %}, or if the block
takes up the entire file.
- If a {% for ... %} block takes up the entire content of an HTML tag,
don't indent it. E.g.
<ul id="navigation">
{% for item in navigation %}
<li><a href="{{ item.href }}">{{ item.caption }}</a></li>
{% endfor %}
</ul>
I tried to follow the examples in the official Jinja documentation as
closely as possible: <http://jinja.pocoo.org/docs/2.10/templates/>.
Used `git diff --check` to perform basic whitespace checks.
[1]: [https://github.com/threedaymonk/htmlbeautifier]
This replaces all `http://` and `//:` links with `https:`. The protocol-
relative URL scheme is now deemed to be an anti-pattern. There are
security advantages to using HTTPS, and there are no significant
performance concerns.
In short, if the asset we need is available via HTTPS, then that asset
should always be loaded via HTTPS.
Fixes#1736
publication time and date and the last modified time and date
independently.
This makes it possible to access the last updated date with {{ article.locale_modified }} in templates.
Additionally, an already delivered feed entry can be corrected by changing the modified date and time, as it is used for atom:update
/ rss pubDate field now.
Deliberate overriding via `save_as` metadata should be allowed, even after the
overwrite detection feature. This commit is to add tests for deliberate
overriding. As a result, the relevant tests *should fail* after this commit.
Added a page and an article, both to override a tag, with very old dates so
it limits the amount of diff in the generated pages.
Overriding feature introduced by d0e9c52410
Overwrite detection introduced by ff7410ce2a
This adds the lstrip_blocks Jinja parameter and removes unnecessary
whitespace from a few notmyidea templates.
Note: The lstrip_blocks parameter requires Jinja 2.7+, which has been
noted in Pelican's setup.py.
Credit for this commit goes entirely to Russ Webber, who has earned my
eternal thanks for discovering and applying this useful Jinja parameter.
Refs #969