archive.ejs 937 B

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