archive.ejs 928 B

123456789101112131415161718192021222324252627282930313233
  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; Prev',
  9. next_text: '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. <a href="<%- url_for('archives/' + year) %>" class="archive-year"><%= year %></a>
  25. </div>
  26. <div class="archives">
  27. <% } %>
  28. <%- partial('archive-post', {post: post, even: i % 2 == 0}) %>
  29. <% }) %>
  30. <% if (page.posts.length){ %>
  31. </div></section>
  32. <% } %>
  33. <% } %>