article.ejs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. <%- partial('post/date', {class_name: 'article-date', date_format: null}) %>
  12. <%- partial('post/category') %>
  13. </div>
  14. </header>
  15. <% } %>
  16. <div class="article-entry" itemprop="articleBody">
  17. <% if (post.excerpt && index){ %>
  18. <%- post.excerpt %>
  19. <% if (theme.excerpt_link){ %>
  20. <p class="article-more-link">
  21. <a href="<%- url_for(post.path) %>#more"><%= theme.excerpt_link %></a>
  22. </p>
  23. <% } %>
  24. <% } else { %>
  25. <% if (!index && post.toc){ %>
  26. <div id="toc" class="toc-article">
  27. <strong class="toc-title">文章目录</strong>
  28. <%- toc(post.content) %>
  29. </div>
  30. <% } %>
  31. <%- post.content %>
  32. <% } %>
  33. </div>
  34. <footer class="article-footer">
  35. <a data-url="<%- post.permalink %>" data-id="<%= post._id %>" class="article-share-link"><%= __('article.share') %></a>
  36. <% if (post.comments && config.disqus_shortname){ %>
  37. <a href="<%- post.permalink %>#disqus_thread" class="article-comment-link"><%= __('article.comments') %></a>
  38. <% } else if (post.comments && config.duoshuo_shortname){ %>
  39. <a href="<%- post.permalink %>#ds-thread" class="article-comment-link"><%= __('article.comments') %></a>
  40. <% } %>
  41. <%- partial('post/tag') %>
  42. </footer>
  43. </div>
  44. <% if (!index){ %>
  45. <%- partial('post/nav') %>
  46. <% } %>
  47. </article>
  48. <% if (!index && post.comments && config.disqus_shortname){ %>
  49. <section id="comments">
  50. <div id="disqus_thread">
  51. <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
  52. </div>
  53. </section>
  54. <% } else if (!index && post.comments && config.duoshuo_shortname){ %>
  55. <section id="comments">
  56. <div id="ds-thread" class="ds-thread" data-thread-key="<%- post.permalink %>" data-title="<%- post.title %>" data-url="<%- post.permalink %>">
  57. <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by DuoShuo.</a></noscript>
  58. </div>
  59. </section>
  60. <% } %>