2019-05-22 23:56:22 +08:00

28 lines
875 B
Plaintext

<% if (pagination == 2){
page.posts.each(function(post, postIndex){ %>
<%- partial('article', {post, param: {index: true, postIndex}}) %>
<% })
} else {
var last;
page.posts.each(function(post, i){
var year = post.date.year();
if (last != year){
if (last != null){ %></div></section><% }
last = year; %>
<section class="archives-wrap">
<div class="archive-year-wrap">
<a href="<%- url_for('archives/' + year) %>" class="archive-year"><%= year %></a>
</div>
<div class="archives">
<% } %>
<%- partial('archive-post', {post: post, even: i % 2 == 0}) %>
<% })
if (page.posts.length){ %></div></section><% }}
if (page.total > 1){ %>
<nav id="page-nav">
<%- paginator({
prev_text: '&laquo; '+__('prev'),
next_text: __('next')+' &raquo;'
}) %>
</nav>
<% } %>