archive.ejs 1005 B

12345678910111213141516171819202122232425262728293031323334
  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. <% var prev_text = "&laquo; " + __('prev');var next_text = __('next') + " &raquo;"%>
  29. <%- paginator({
  30. prev_text: prev_text,
  31. next_text: next_text
  32. }) %>
  33. </nav>
  34. <% } %>