2021-02-19 23:33:19 +08:00
|
|
|
<%
|
2021-02-21 13:44:11 +08:00
|
|
|
page.robots = 'noindex,follow';
|
2021-02-21 03:13:21 +08:00
|
|
|
if (page.menu_id == undefined) {
|
|
|
|
page.menu_id = 'post';
|
2021-02-19 23:33:19 +08:00
|
|
|
}
|
|
|
|
%>
|
|
|
|
<% if (page.posts && (is_category() || is_tag())) { %>
|
|
|
|
<%- partial('index') %>
|
|
|
|
<% } else { %>
|
|
|
|
<% page.title = __('btn.archives'); %>
|
2021-02-20 13:09:41 +08:00
|
|
|
<%- partial('_partial/main/navbar/list_post') %>
|
2021-02-19 23:33:19 +08:00
|
|
|
<div class='post-list'>
|
|
|
|
<% var years = []; %>
|
|
|
|
<% site.posts.sort('date', -1).each(function(post) { %>
|
|
|
|
<% post.year = date(post.date, 'YYYY'); %>
|
|
|
|
<% if (post.year && (years.includes(post.year) == false) && (post.title || post.date)) { %>
|
|
|
|
<% years.push(post.year); %>
|
|
|
|
<% } %>
|
|
|
|
<% }); %>
|
|
|
|
<% years.forEach((year, i) => { %>
|
2021-11-06 16:00:03 +08:00
|
|
|
<article class='<%- scrollreveal() %>' id='archive'>
|
|
|
|
<div class='archive-header h4'><%= year %></div>
|
2021-02-19 23:33:19 +08:00
|
|
|
<% site.posts.sort('date', -1).filter(function (post) { %>
|
|
|
|
<% post.year = date(post.date, 'YYYY'); %>
|
|
|
|
<% return post.year == year; %>
|
|
|
|
<% }).each(function(post) { %>
|
2021-11-06 16:00:03 +08:00
|
|
|
<div class='archive-list'>
|
2021-03-05 21:37:28 +08:00
|
|
|
<a class='post fs14' href="<%= url_for(post.link || post.path) %>">
|
2021-02-19 23:33:19 +08:00
|
|
|
<time><%= date(post.date, 'MM-DD') %></time>
|
|
|
|
<span>
|
|
|
|
<% if (post.title) { %>
|
|
|
|
<%- post.title %>
|
|
|
|
<% } else if (post.date) { %>
|
|
|
|
<%= date(post.date, config.date_format) %>
|
|
|
|
<% } %>
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<% }); %>
|
|
|
|
</article>
|
|
|
|
<% }); %>
|
|
|
|
</div>
|
|
|
|
<% } %>
|