37 lines
1.0 KiB
Plaintext
37 lines
1.0 KiB
Plaintext
<% if (pagination == 2){ %>
|
|
<section class="previews-section">
|
|
<% page.posts.each(function(post){ %>
|
|
<%- partial('article-preview', {post: post, index: true}) %>
|
|
<% }) %>
|
|
</section>
|
|
<% } 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">
|
|
<h1><a href="<%- url_for(config.archive_dir + '/' + year) %>" class="archive-year"><%= year %></a></h1>
|
|
</div>
|
|
<div class="previews-section archives">
|
|
<% } %>
|
|
<%- partial('article-preview', {post: post, index: true}) %>
|
|
<% }) %>
|
|
<% if (page.posts.length){ %>
|
|
</div></section>
|
|
<% } %>
|
|
<% } %>
|
|
<% if (page.total > 1){ %>
|
|
<nav id="page-nav">
|
|
<% var prev_text = "< " + __('prev');var next_text = __('next') + " >"%>
|
|
<%- paginator({
|
|
prev_text: prev_text,
|
|
next_text: next_text
|
|
}) %>
|
|
</nav>
|
|
<% } %>
|