Add "last updated" info regardless if updated is present in the front matter

This commit is contained in:
Leilukin 2025-04-02 16:28:27 +08:00 committed by Helen Chong
parent 6f6da77aa7
commit 6038081915

View File

@ -4,4 +4,6 @@ layout: main/content
{{ content | safe }}
<p class="update-info">(This {{ keyword }} was last updated on <time datetime="{{ updated }}">{{ updated | formatDate }}</time>)</p>
{%- set lastUpdated -%}{{ updated if updated else date }}{%- endset -%}
<p class="update-info">(This {{ keyword if keyword else "page" }} was last updated on <time datetime="{{ lastUpdated }}">{{ lastUpdated | formatDate }}</time>)</p>