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

30 lines
794 B
Plaintext
Raw Normal View History

<% const posts = is_archive() ? site.posts : page.posts %>
<div class="archive-container">
<% let last; %>
<% 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 (posts.length){ %>
</div>
</section>
<% } %>
</div>