8000 feat(modified): show Last Updated only if the difference between crea… · Pelican-Elegant/elegant@b0eac79 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit b0eac79

Browse files
committed
feat(modified): show Last Updated only if the difference between created and modified is more than a day
1 parent de1d05b commit b0eac79

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templates/_includes/last_updated.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
If it is >3.3 than modified is a datetime object
44
#}
55
{% if article.locale_modified and article.modified %}
6-
6+
{% set delta = (article.modified - article.date).days %}
7+
{% if delta > 0 %}
78
<h4>Last Updated</h4>
89
{% set day = article.modified.strftime('%d')|int %}
910
<time datetime="{{ article.modified.isoformat() }}">{{ article.modified.strftime('%b') }} {{ day }} {{- article.modified.strftime(', %Y') }}</time>
11+
{% endif %}
1012

1113
{% elif article.modified %}
1214
<h4>Last Updated</h4>

0 commit comments

Comments
 (0)
0