Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only show 'Last updated on ...' when last_updated defined #183

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Mar 25, 2024

Fixes #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.

@hugovk hugovk added the bug label Mar 25, 2024
@hugovk hugovk changed the title Only show 'Last updated on ...' when last_updated defined Only show 'Last updated on ...' when last_updated defined Mar 25, 2024
@hugovk hugovk merged commit 439dd95 into python:main Mar 25, 2024
9 checks passed
@hugovk hugovk deleted the fix-last-updated-on-none branch March 25, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Footer: "Last updated on None"
2 participants