Closed hugovk closed 4 months ago
Fixes https://github.com/python/python-docs-theme/issues/182.
We were always showing it:
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
Instead, we should check the variable first:
{%- if last_updated %} {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} {%- endif %}
This is also what Sphinx does:
https://github.com/sphinx-doc/sphinx/blob/2e05fd2ffe70b2cfd48bdb9e35eecac43b46637d/sphinx/themes/basic/layout.html#L211-L213
Also add some newlines around other if blocks to make them clearer.
if
Fixes https://github.com/python/python-docs-theme/issues/182.
We were always showing it:
Instead, we should check the variable first:
This is also what Sphinx does:
https://github.com/sphinx-doc/sphinx/blob/2e05fd2ffe70b2cfd48bdb9e35eecac43b46637d/sphinx/themes/basic/layout.html#L211-L213
Also add some newlines around other
if
blocks to make them clearer.