archive.ejs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <% if (page.year || page.month) { %>
  2. <%- partial('_partial/archive') %>
  3. <% } else { %>
  4. <article id="archive-page" class="post article white-box">
  5. <section class='meta'>
  6. <h2 class="title">
  7. <a href="javascript:void(0)">
  8. Archives
  9. </a>
  10. </h2>
  11. </section>
  12. <section class="archive">
  13. <%
  14. var year = -1, postid = -1;
  15. site.posts.sort('date', -1).each(function(post) {
  16. post.year = date(post.date, 'YYYY');
  17. if (post.year && post.year !== year) {
  18. year = post.year;
  19. %>
  20. <div class="archive-item archive-year mark">
  21. <a id="archive-year-<%= year %>" href='<%= url_for("/archives/" + year + "/") %>' >
  22. <%= year %>
  23. </a>
  24. </div>
  25. <% } %>
  26. <div class="archive-item archive-post mark">
  27. <a href="<%= url_for(post.path) %>">
  28. <time><%= date(post.date, 'MM-DD') %></time>
  29. <span class="title"><span><%= post.title %></span></span>
  30. </a>
  31. </div>
  32. <% }); %>
  33. </section>
  34. </article>
  35. <!--
  36. <% if (page.total > 1) { %>
  37. <nav id="page-nav">
  38. <% if (page.prev != 0) { %>
  39. <a class="prev" rel="prev" href="<%= url_for(page.prev_link) %>">
  40. <span class="icon icon-chevron-left"></span>
  41. <span class="text">Previous</span>
  42. </a>
  43. <% } %>
  44. <% if (page.next != 0) { %>
  45. <a class="next" rel="next" href="<%= url_for(page.next_link) %>">
  46. <span class="text">Next</span>
  47. <span class="icon icon-chevron-right"></span>
  48. </a>
  49. <% } %>
  50. </nav>
  51. <% } %>
  52. -->
  53. <% } %>