Added a post.date condition in date.ejs

Signed-off-by: Xiaofeng QU <xiaofeng.qu.hk@ieee.org>
This commit is contained in:
Xiaofeng QU 2015-07-11 09:13:07 +08:00
parent 9396bc1994
commit 43a209bbd4
2 changed files with 9 additions and 7 deletions

View File

@ -7,7 +7,7 @@
<% if (post.link || post.title){ %>
<header class="article-header">
<%- partial('post/title', {class_name: 'article-title'}) %>
<div class="article-meta">
<div class="article-meta">
<%- partial('post/date', {class_name: 'article-date', date_format: null}) %>
<%- partial('post/category') %>
</div>

View File

@ -1,6 +1,8 @@
<div class="<%= class_name %>">
<i class="fa fa-calendar"></i>
<a href="<%- url_for(post.path) %>">
<time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date, date_format) %></time>
</a>
</div>
<% if (post.date){ %>
<div class="<%= class_name %>">
<i class="fa fa-calendar"></i>
<a href="<%- url_for(post.path) %>">
<time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date, date_format) %></time>
</a>
</div>
<% } %>