{# code for Page and Article is exactly the same #} {% if article %} {# Check which version of Pelican user is using. If it is <=3.3 than modified is a string If it is >3.3 than modified is a datetime object #} {% if article.locale_modified and article.modified %} {# This check is necessary because modified is set to date by default. It should be displayed only if user has explicitly set it. #} {% if article.modified != article.date %}

Last Updated

{% set day = article.modified.strftime('%d')|int %} {% endif %} {% elif article.modified %}

Last Updated

{{ article.modified }}
{% endif %} {# code for Page #} {% elif page %} {% if page.locale_modified and page.modified %} {% if page.modified != page.date %}

Last Updated

{% set day = page.modified.strftime('%d')|int %} {% endif %} {% elif page.modified %}

Last Updated

{{ page.modified }}
{% endif %} {% endif %}