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 %>"> <article class="archive-article archive-type-<%= post.layout %>">
<div class="archive-article-inner"> <div class="archive-article-inner">
<header class="archive-article-header"> <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'}) %> <%- partial('post/title', {class_name: 'archive-article-title'}) %>
</header> </header>
</div> </div>

View File

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

View File

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

View File

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