Jelajahi Sumber

Merge pull request #29 from quxiaofeng/master

Added a `hidedate` option to article.ejs
ppoffice 10 tahun lalu
induk
melakukan
eaadad789b
2 mengubah file dengan 9 tambahan dan 7 penghapusan
  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>
+<% } %>