Skip to content

Commit

Permalink
feat(modified): show Last Updated only if the difference between crea…
Browse files Browse the repository at this point in the history
…ted and modified is more than a day
  • Loading branch information
talha131 committed Jul 5, 2019
1 parent de1d05b commit b0eac79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion templates/_includes/last_updated.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
If it is >3.3 than modified is a datetime object
#}
{% if article.locale_modified and article.modified %}

{% set delta = (article.modified - article.date).days %}
{% if delta > 0 %}
<h4>Last Updated</h4>
{% set day = article.modified.strftime('%d')|int %}
<time datetime="{{ article.modified.isoformat() }}">{{ article.modified.strftime('%b') }} {{ day }} {{- article.modified.strftime(', %Y') }}</time>
{% endif %}

{% elif article.modified %}
<h4>Last Updated</h4>
Expand Down

0 comments on commit b0eac79

Please sign in to comment.