last_updated.html 752 B

12345678910111213141516171819202122232425
  1. {# Check which version of Pelican user is using.
  2. If it is <=3.3 than modified is a string
  3. If it is >3.3 than modified is a datetime object
  4. #}
  5. {% if article.locale_modified and article.modified %}
  6. {# This check is necessary because modified is set to date by default.
  7. It should be displayed only if user has explicitly set it.
  8. #}
  9. {% if article.modified != article.date %}
  10. <h4>Last Updated</h4>
  11. {% set day = article.modified.strftime('%d')|int %}
  12. <time datetime="{{ article.modified.isoformat() }}">{{ article.modified.strftime('%b') }} {{ day }} {{- article.modified.strftime(', %Y') }}</time>
  13. {% endif %}
  14. {% elif article.modified %}
  15. <h4>Last Updated</h4>
  16. <div class="last-updated">{{ article.modified }}</div>
  17. {% endif %}