FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Only show 'Last updated on ...' when `last_updated` defined by hugovk · Pull Request #183 · python/python-docs-theme · GitHub

Repository navigation

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

Merged
hugovk merged 2 commits into
python:mainfrom
hugovk:fix-last-updated-on-none
Mar 25, 2024
Merged

hugovk merged 2 commits into
python:mainfrom
hugovk:fix-last-updated-on-none

Conversation

hugovk commented Mar 25, 2024 •
edited
Loading

Copy link
Copy Markdown
Member

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 added the bug label Mar 25, 2024
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 merged commit 439dd95 into python:main Mar 25, 2024
hugovk deleted the fix-last-updated-on-none branch March 25, 2024 15:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL