mirror of https://gitlab.com/curben/blog
feat: add updated date
post.updated variable is not used because it's the time 'hexo generate' is executed, post.updated includes non-content update.
This commit is contained in:
parent
9e1620e7ce
commit
316aa03bd8
|
@ -18,3 +18,4 @@ rss_feed: RSS Feed
|
||||||
category: Category
|
category: Category
|
||||||
tag: Tag
|
tag: Tag
|
||||||
date_published: Published Date
|
date_published: Published Date
|
||||||
|
date_updated: Last Updated
|
||||||
|
|
|
@ -18,3 +18,4 @@ rss_feed: RSS Feed
|
||||||
category: Category
|
category: Category
|
||||||
tag: Tag
|
tag: Tag
|
||||||
date_published: Published Date
|
date_published: Published Date
|
||||||
|
date_updated: Last Updated
|
||||||
|
|
|
@ -23,6 +23,12 @@
|
||||||
</div>
|
</div>
|
||||||
<footer class="article-footer">
|
<footer class="article-footer">
|
||||||
<ul class="article-meta">
|
<ul class="article-meta">
|
||||||
|
<% if (post.lastUpdated) { %>
|
||||||
|
<li>
|
||||||
|
<span class="label"><%= __('date_updated') %>:</span>
|
||||||
|
<%- partial('post/updated-date', {class_name: 'article-date', date_format: 'D MMM YYYY'}) %>
|
||||||
|
</li>
|
||||||
|
<% } %>
|
||||||
<li>
|
<li>
|
||||||
<span class="label"><%= __('date_published') %>:</span>
|
<span class="label"><%= __('date_published') %>:</span>
|
||||||
<%- partial('post/date', {class_name: 'article-date', date_format: 'D MMM YYYY'}) %>
|
<%- partial('post/date', {class_name: 'article-date', date_format: 'D MMM YYYY'}) %>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<%/* User-specified updated date */%>
|
||||||
|
<%/* default post.updated is (almost) always is the time 'hexo generate' is executed */%>
|
||||||
|
<a href="<%- url_for(post.path) %>" class="<%= class_name %>">
|
||||||
|
<time datetime="<%= date_xml(post.lastUpdated) %>" itemprop="dateUpdated"><%= date(post.lastUpdated, date_format) %></time>
|
||||||
|
</a>
|
Loading…
Reference in New Issue