ソースを参照

Merge pull request #29 from quxiaofeng/master

Added a `hidedate` option to article.ejs
ppoffice 10 年 前
コミット
eaadad789b
2 ファイル変更9 行追加7 行削除
  1. 1 1
      layout/_partial/article.ejs
  2. 8 6
      layout/_partial/post/date.ejs

+ 1 - 1
layout/_partial/article.ejs

@@ -52,4 +52,4 @@
       <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by DuoShuo.</a></noscript>
       </div>
   </section>
-<% } %>
+<% } %>

+ 8 - 6
layout/_partial/post/date.ejs

@@ -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 && !post.hidedate){ %>
+  <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>
+<% } %>