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

34 lines
991 B
Plaintext
Raw Normal View History

<% if (!theme.groupByYear){ %>
2015-03-19 14:25:53 +00:00
<% page.posts.each(function(post){ %>
<%- partial('article', {post: post, index: true}) %>
<% }) %>
<% if (page.total > 1){ %>
<nav id="page-nav">
<%- paginator({
2015-03-20 09:29:51 +00:00
prev_text: '&laquo; ' + __('nav.prev'),
next_text: __('nav.next') + ' &raquo;'
2015-03-19 14:25:53 +00:00
}) %>
</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">
2015-03-20 09:29:51 +00:00
<i class="fa fa-calendar"></i>
2015-03-19 14:25:53 +00:00
<a href="<%- url_for('archives/' + year) %>" class="archive-year"><%= year %></a>
</div>
<% } %>
2015-03-20 09:29:51 +00:00
<%- partial('article', {post: post, index: true}) %>
2015-03-19 14:25:53 +00:00
<% }) %>
2015-03-20 10:33:17 +00:00
<% if (page.total > 1){ %>
<nav id="page-nav">
<%- paginator({
prev_text: '&laquo; ' + __('nav.prev'),
next_text: __('nav.next') + ' &raquo;'
}) %>
</nav>
2015-03-19 14:25:53 +00:00
<% } %>
<% } %>