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
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<hr/>
|
<hr/>
|
||||||
<div class="article-inner">
|
<div class="article-inner">
|
||||||
<%- partial('post/gallery') %>
|
<%- partial('post/gallery') %>
|
||||||
<% if (post.link || post.title){ %>
|
<% if (post.link || post.title) { %>
|
||||||
<header class="article-header">
|
<header class="article-header">
|
||||||
<%- partial('post/title', {class_name: 'article-title'}) %>
|
<%- partial('post/title', {class_name: 'article-title'}) %>
|
||||||
</header>
|
</header>
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
<div class="article-entry typo" itemprop="articleBody">
|
<div class="article-entry typo" itemprop="articleBody">
|
||||||
<% if (post.excerpt && index){ %>
|
<% if (post.excerpt && index){ %>
|
||||||
<%- post.excerpt %>
|
<%- post.excerpt %>
|
||||||
<% if (theme.excerpt_link){ %>
|
<% if (theme.excerpt_link) { %>
|
||||||
<p class="article-more-link">
|
<p class="article-more-link">
|
||||||
<%- link_to(url_for(post.path)+'#more', theme.excerpt_link) %>
|
<%- link_to(url_for(post.path)+'#more', theme.excerpt_link) %>
|
||||||
</p>
|
</p>
|
||||||
|
@ -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'}) %>
|
||||||
|
@ -33,7 +39,7 @@
|
||||||
<%- partial('post/category') %>
|
<%- partial('post/category') %>
|
||||||
</li>
|
</li>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (post.tags && post.tags.length){ %>
|
<% if (post.tags && post.tags.length) { %>
|
||||||
<li>
|
<li>
|
||||||
<span class="label"><%= __('tag') %>:</span>
|
<span class="label"><%= __('tag') %>:</span>
|
||||||
<%- partial('post/tag') %>
|
<%- partial('post/tag') %>
|
||||||
|
@ -43,7 +49,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
<% if (!index){ %>
|
<% if (!index) { %>
|
||||||
<%- partial('post/nav') %>
|
<%- partial('post/nav') %>
|
||||||
<% } %>
|
<% } %>
|
||||||
</article>
|
</article>
|
||||||
|
|
|
@ -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