article.ejs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <article id="<%= post.layout %>-<%= post.slug %>"
  2. class="post white-box article-type-<%= post.layout %>"
  3. itemscope itemprop="blogPost">
  4. <section class='meta'>
  5. <h2 class="title">
  6. <a href="<%- url_for(post.path) %>">
  7. <%= post.title %>
  8. </a>
  9. </h2>
  10. <time>
  11. <%= date(post.date, 'MMM D, YYYY') %>
  12. </time>
  13. <%- partial('categories', {post: post}) %>
  14. </section>
  15. <% if(post.toc !== false){ %>
  16. <section class="toc-wrapper"><%- toc(post.content) %></section>
  17. <% } %>
  18. <section class="article typo">
  19. <div class="article-entry" itemprop="articleBody">
  20. <%- post.content %>
  21. </div>
  22. <% if (post.tags && post.tags.length) { %>
  23. <div class="article-tags tags">
  24. <% post.tags.each(function(item){ %>
  25. <a href="<%- url_for(item.path) %>"><%= item.name %></a>
  26. <% }) %>
  27. </div>
  28. <% } %>
  29. <% if(post.prev || post.next){ %>
  30. <div class="art-item-footer">
  31. <% if(post.prev){ %>
  32. <span class="art-item-left"><i class="icon icon-chevron-thin-left"></i>prev:<a
  33. href="<%= url_for(post.prev.path) %>" rel="prev" title="<%= post.prev.title %>">
  34. <%= post.prev.title %>
  35. </a></span>
  36. <% } %>
  37. <% if(post.next){ %>
  38. <span class="art-item-right">next:<a href="<%= url_for(post.next.path) %>" rel="next"
  39. title="<%= post.next.title %>">
  40. <%= post.next.title %>
  41. </a><i class="icon icon-chevron-thin-right"></i></span>
  42. <% } %>
  43. </div>
  44. <% } %>
  45. </section>
  46. <!--打赏-->
  47. <div class="reward">
  48. <div class="reward-button">赏 <span class="reward-code">
  49. <span class="alipay-code"> <img class="alipay-img wdp-appear" src="https://dzdy-1252491474.cos.ap-chengdu.myqcloud.com/alipay.jpg"><b>支付宝打赏</b> </span>
  50. <span class="wechat-code"> <img class="wechat-img wdp-appear" src="https://dzdy-1252491474.cos.ap-chengdu.myqcloud.com/wechat.jpg"><b>微信打赏</b> </span>
  51. </span>
  52. </div>
  53. <p class="reward-notice">如果文章对你有帮助,欢迎点击上方按钮打赏作者</p>
  54. </div>
  55. <!--打赏-->
  56. <% if (post.comments && config.disqus_shortname){ %>
  57. <section id="comments">
  58. <div id="disqus_thread"></div>
  59. </section>
  60. <% } %>
  61. <% if (theme.valine.enable && theme.valine.appId && theme.valine.appKey){ %>
  62. <section id="comments">
  63. <div id="valine_container" class="valine_thread"></div>
  64. <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  65. <script src="//unpkg.com/valine/dist/Valine.min.js"></script>
  66. <script>
  67. var GUEST_INFO = ['nick', 'mail', 'link'];
  68. var guest_info = '<%= theme.valine.guest_info %>'.split(',').filter(function (item) {
  69. return GUEST_INFO.indexOf(item) > -1
  70. });
  71. var notify = '<%= theme.valine.notify %>' == true;
  72. var verify = '<%= theme.valine.verify %>' == true;
  73. var valine = new Valine();
  74. valine.init({
  75. el: '#valine_container',
  76. notify: notify,
  77. verify: verify,
  78. guest_info: guest_info,
  79. appId: "<%= theme.valine.appId %>",
  80. appKey: "<%= theme.valine.appKey %>",
  81. placeholder: "<%= theme.valine.placeholder %>",
  82. pageSize: '<%= theme.valine.pageSize %>',
  83. avatar: '<%= theme.valine.avatar %>',
  84. lang: '<%= theme.valine.lang %>'
  85. })
  86. </script>
  87. </section>
  88. <% } %>
  89. </article>
  90. <script>
  91. window.subData = {
  92. title: '<%= post.title %>',
  93. tools: true
  94. }
  95. </script>