hexo-theme-amane/layout/_partial/archive.ejs

34 lines
988 B
Plaintext

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