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

60 lines
1.9 KiB
Plaintext
Raw Normal View History

2016-02-02 16:19:44 +00:00
<% switch (type) {
case 'archive':
var last;
page.posts.each(function(post, i) {
2016-02-05 16:11:56 +00:00
var year = post.date.year();
if (last != year) {
if (last != null) { %>
</div></section>
<% }
last = year; %>
<div class="archive-year-wrap">
<a href="<%- url_for('archives/' + year) %>" class="archive-year"><%= year %></a>
</div>
<section class="archives-wrap">
<div class="archives">
<% } %>
<%- partial('summary', {post: post, archive: true}) %>
<% });
2016-02-02 16:19:44 +00:00
if (page.posts.length) { %>
</div></section>
<% }
break;
case 'category': %>
<section class="archives-wrap">
<div class="archive-category-wrap">
<span class="archive-category"><%= page.category %></span>
</div>
<div class="archives">
<% page.posts.each(function (post, i) { %>
2016-02-05 14:05:37 +00:00
<%- partial('summary', {post: post, archive: false}) %>
2016-02-02 16:19:44 +00:00
<% }); %>
</div></section>
2016-02-05 16:11:56 +00:00
<%
2016-02-02 16:19:44 +00:00
break;
case 'tag': %>
<section class="archives-wrap">
<div class="archive-tag-wrap">
<span class="archive-tag">#<%= page.tag %></span>
</div>
<div class="archives">
<% page.posts.each(function (post, i) { %>
2016-02-05 14:05:37 +00:00
<%- partial('summary', {post: post, archive: false}) %>
2016-02-02 16:19:44 +00:00
<% }); %>
</div></section>
2016-02-05 16:11:56 +00:00
<%
2016-02-02 16:19:44 +00:00
break;
default:
page.posts.each(function(post) { %>
2016-02-05 16:11:56 +00:00
<%- partial('article', { post: post, index: true }) %>
2016-02-02 16:19:44 +00:00
<% })
break;
2016-02-05 16:11:56 +00:00
}
if (page.total > 1) { %>
<nav id="page-nav">
<%- paginator({
prev_text: '&laquo; ' + __('nav.prev'),
next_text: __('nav.next') + ' &raquo;'
}) %>
</nav>
<% } %>