hexo-theme-keep/layout/common/archive-post.ejs

43 lines
972 B
Plaintext
Raw Normal View History

<!-- 归档页面 内容 -->
<% if (is_archive()) { %>
<div class="archive-container">
<!-- 把所有文章按年份分类显示 -->
<% let last; %>
<% site.posts.each(function(post, i){ %>
<% let year = post.date.year(); %>
<% if (last != year) { %>
<% if (last != null){ %>
</div></section>
<% } %>
<% last = year; %>
<section class="archives-wrap">
<div class="archive-year">
<%= year %>
</div>
<div class="archive-article-list">
<% } %>
<div class="archive-article-item">
<a class="archive-article-title" href="<%- url_for(post.path) %>"><%= post.title %></a>
<span class="archive-article-date"> <%= date(post.date, 'MM-DD') %> </span>
</div>
<% }) %>
<% if (site.posts.length){ %>
</div>
</section>
<% } %>
</div>
<% } %>