12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <% switch (type) {
- case 'archive':
- var last;
- page.posts.each(function(post, i){
- var year = post.date.year();
- if (last != year){
- if (last != null){ %>
- </div></section>
- <% }
- last = year; %>
- <div class="archive-year-wrap">
- <a href="<%- url_for('archives/' + year) %>" class="archive-year"><%= year %></a>
- </div>
- <section class="archives-wrap">
- <div class="archives">
- <% } %>
- <%- partial('archive-post', {post: post, archive: true}) %>
- <% });
- if (page.posts.length){ %>
- </div></section>
- <% }
- if (page.total > 1){ %>
- <nav id="page-nav">
- <%- paginator({
- prev_text: '« ' + __('nav.prev'),
- next_text: __('nav.next') + ' »'
- }) %>
- </nav>
- <% }
- break;
- case 'category': %>
- <section class="archives-wrap">
- <div class="archive-category-wrap">
- <span class="archive-category"><%= page.category %></span>
- </div>
- <div class="archives">
- <% page.posts.each(function (post, i) { %>
- <%- partial('archive-post', {post: post, archive: false}) %>
- <% }); %>
- </div></section>
- <% if (page.total > 1){ %>
- <nav id="page-nav">
- <%- paginator({
- prev_text: '« ' + __('nav.prev'),
- next_text: __('nav.next') + ' »'
- }) %>
- </nav>
- <% }
- break;
- case 'tag': %>
- <section class="archives-wrap">
- <div class="archive-tag-wrap">
- <span class="archive-tag">#<%= page.tag %></span>
- </div>
- <div class="archives">
- <% page.posts.each(function (post, i) { %>
- <%- partial('archive-post', {post: post, archive: false}) %>
- <% }); %>
- </div></section>
- <% if (page.total > 1){ %>
- <nav id="page-nav">
- <%- paginator({
- prev_text: '« ' + __('nav.prev'),
- next_text: __('nav.next') + ' »'
- }) %>
- </nav>
- <% }
- break;
- default:
- page.posts.each(function(post){ %>
- <%- partial('article', {post: post, index: true}) %>
- <% })
- if (page.total > 1){ %>
- <nav id="page-nav">
- <%- paginator({
- prev_text: '« ' + __('nav.prev'),
- next_text: __('nav.next') + ' »'
- }) %>
- </nav>
- <% }
- break;
- } %>
|