archive.ejs 988 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. <% last = year; %>
  19. <div class="archive-year-wrap">
  20. <i class="fa fa-calendar"></i>
  21. <a href="<%- url_for('archives/' + year) %>" class="archive-year"><%= year %></a>
  22. </div>
  23. <% } %>
  24. <%- partial('article', {post: post, index: true}) %>
  25. <% }) %>
  26. <% if (page.total > 1){ %>
  27. <nav id="page-nav">
  28. <%- paginator({
  29. prev_text: '&laquo; ' + __('nav.prev'),
  30. next_text: __('nav.next') + ' &raquo;'
  31. }) %>
  32. </nav>
  33. <% } %>
  34. <% } %>