blog/themes/typing/layout/_partial/archive.ejs

35 lines
886 B
Plaintext
Raw Normal View History

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