fix: display date using <span> instead of <a>

* unify date_format options
This commit is contained in:
curben 2019-06-04 13:55:43 +09:30
parent ab5161bbc8
commit bb87e3b914
4 changed files with 12 additions and 12 deletions

View File

@ -1,7 +1,7 @@
<article class="archive-article archive-type-<%= post.layout %>">
<div class="archive-article-inner">
<header class="archive-article-header">
<%- partial('post/date', {class_name: 'archive-article-date', date_format: 'D MMM YYYY'}) %>
<span class="archive-article-date"><%- partial('post/date') %></span>
<%- partial('post/title', {class_name: 'archive-article-title'}) %>
</header>
</div>

View File

@ -25,13 +25,17 @@
<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'}) %>
<span class="label">
<%= __('date_updated') %>:
<%- partial('post/updated-date') %>
</span>
</li>
<% } %>
<li>
<span class="label"><%= __('date_published') %>:</span>
<%- partial('post/date', {class_name: 'article-date', date_format: 'D MMM YYYY'}) %>
<span class="label">
<%= __('date_published') %>:
<%- partial('post/date') %>
</span>
</li>
<% if (post.categories && post.categories.length) { %>
<li>

View File

@ -1,4 +1,2 @@
<a href="<%- url_for(post.path) %>" class="<%= class_name %>">
<%/* Date format is specified to skip timezone conversion */%>
<time datetime="<%= date(post.date, 'YYYY-MM-DD[T00:00:00.000Z]') %>" itemprop="datePublished"><%= date(post.date, date_format) %></time>
</a>
<%/* Date format is specified to skip timezone conversion */%>
<time datetime="<%= date(post.date, 'YYYY-MM-DD[T00:00:00.000Z]') %>" itemprop="datePublished"><%= date(post.date, 'D MMM YYYY') %></time>

View File

@ -1,5 +1,3 @@
<%/* 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(post.lastUpdated, 'YYYY-MM-DD[T00:00:00.000Z]') %>" itemprop="dateUpdated"><%= date(post.lastUpdated, date_format) %></time>
</a>
<time datetime="<%= date(post.lastUpdated, 'YYYY-MM-DD[T00:00:00.000Z]') %>" itemprop="dateUpdated"><%= date(post.lastUpdated, 'D MMM YYYY') %></time>