blog-hexo/themes/hexo-theme-cosy/layout/archive.ejs

1 line
860 B
Plaintext
Raw Normal View History

2023-10-24 09:48:00 +08:00
<%- css("/css/efca006a.css")%><% var archive = {}; %><% site.posts.forEach(function(post){ %><% var year = post.date.year(); %><% if(!archive[year]) { %><% archive[year] = []; %><% } %><% archive[year].push(post); %><% }); %><div class="archive scrollbar-obtrusive"><ul><% for(var key in archive) { %><li><h2><%= key %></h2><ul class="timeline"><% archive[key].forEach(function(post){ %><li><a class="timeline-item" href="<%- url_for(post.path) %>"><div class="timeline-info"><span><%= post.date.format('MM-DD HH:mm:ss') %></span></div><div class="timeline-marker"></div><div class="timeline-content"><div class="timeline-title"><% if(post.status !==undefined){ %><%- post_icon(post,'status') %><% } %><span><%= post.title %></span></div><p><%= generate_excerpt(post, 100) %>...</p></div></a></li><% }) %></ul></li><% } %></ul></div><%- js("/js/31d6cfe0.js")%>