Skip to content

Conversation

@hugovk
Copy link
Member

@hugovkhugovk commented Mar 25, 2024

Fixes#182.

We were always showing it:

{%translast_updated=last_updated|e%}Last updated on{{last_updated }}.{%endtrans%}

Instead, we should check the variable first:

{%- iflast_updated%}{%translast_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.

@hugovkhugovk added the bug label Mar 25, 2024
@hugovkhugovk changed the title Only show 'Last updated on ...' when last_updated definedOnly show 'Last updated on ...' when last_updated definedMar 25, 2024
@hugovkhugovk merged commit 439dd95 into python:mainMar 25, 2024
@hugovkhugovk deleted the fix-last-updated-on-none branch March 25, 2024 15:53
Sign up for freeto 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

@hugovk@ezio-melotti