article.ejs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <article id="<%= post.layout %>-<%= post.slug %>" class="article article-type-<%= post.layout %>" itemscope itemprop="blogPost">
  2. <div class="article-inner">
  3. <% if (post.banner){ %>
  4. <%- partial('post/banner') %>
  5. <% } %>
  6. <%- partial('post/gallery') %>
  7. <% if (post.link || post.title){ %>
  8. <header class="article-header">
  9. <%- partial('post/title', {class_name: 'article-title'}) %>
  10. <div class="article-meta">
  11. <% if (!post.hidedate){ %>
  12. <%- partial('post/date', {class_name: 'article-date', date_format: null}) %>
  13. <% } %>
  14. <%- partial('post/category') %>
  15. </div>
  16. </header>
  17. <% } %>
  18. <div class="article-entry" itemprop="articleBody">
  19. <% if (post.excerpt && index){ %>
  20. <%- post.excerpt %>
  21. <% if (theme.excerpt_link){ %>
  22. <p class="article-more-link">
  23. <a href="<%- url_for(post.path) %>#more"><%= theme.excerpt_link %></a>
  24. </p>
  25. <% } %>
  26. <% } else { %>
  27. <%- post.content %>
  28. <% } %>
  29. </div>
  30. <footer class="article-footer">
  31. <a data-url="<%- post.permalink %>" data-id="<%= post._id %>" class="article-share-link"><%= __('article.share') %></a>
  32. <% if (post.comments && config.disqus_shortname){ %>
  33. <a href="<%- post.permalink %>#disqus_thread" class="article-comment-link"><%= __('article.comments') %></a>
  34. <% } else if (post.comments && config.duoshuo_shortname){ %>
  35. <a href="<%- post.permalink %>#ds-thread" class="article-comment-link"><%= __('article.comments') %></a>
  36. <% } %>
  37. <%- partial('post/tag') %>
  38. </footer>
  39. </div>
  40. <% if (!index){ %>
  41. <%- partial('post/nav') %>
  42. <% } %>
  43. </article>
  44. <% if (!index && post.comments && config.disqus_shortname){ %>
  45. <section id="comments">
  46. <div id="disqus_thread">
  47. <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
  48. </div>
  49. </section>
  50. <% } else if (!index && post.comments && config.duoshuo_shortname){ %>
  51. <section id="comments">
  52. <div id="ds-thread" class="ds-thread" data-thread-key="<%- post.permalink %>" data-title="<%- post.title %>" data-url="<%- post.permalink %>">
  53. <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by DuoShuo.</a></noscript>
  54. </div>
  55. </section>
  56. <% } %>