archive.ejs 986 B

12345678910111213141516171819202122232425262728293031323334
  1. <% if (pagination == 2){ %>
  2. <% page.posts.each(function(post){ %>
  3. <%- partial('article', {post: post, index: true}) %>
  4. <% }) %>
  5. <% if (page.total > 1){ %>
  6. <nav id="page-nav">
  7. <%- paginator({
  8. prev_text: '&laquo; ' + __('nav.prev'),
  9. next_text: __('nav.next') + ' &raquo;'
  10. }) %>
  11. </nav>
  12. <% } %>
  13. <% } else { %>
  14. <% var last; %>
  15. <% page.posts.each(function(post, i){ %>
  16. <% var year = post.date.year(); %>
  17. <% if (last != year){ %>
  18. <% if (last != null){ %>
  19. </div></section>
  20. <% } %>
  21. <% last = year; %>
  22. <section class="archives-wrap">
  23. <div class="archive-year-wrap">
  24. <i class="fa fa-calendar"></i>
  25. <a href="<%- url_for('archives/' + year) %>" class="archive-year"><%= year %></a>
  26. </div>
  27. <div class="archives">
  28. <% } %>
  29. <%- partial('article', {post: post, index: true}) %>
  30. <% }) %>
  31. <% if (page.posts.length){ %>
  32. </div></section>
  33. <% } %>
  34. <% } %>