目前共计 <%= site.posts.length %> 篇文章

<% var last = 0, year, yearArr = []; %> <% site.posts.sort('date', -1).limit(site.posts.length).each(function(post){ %> <% year = post.date.year(); %> <% if (last != year){ %> <% if (yearArr.length != 0){ %> <% } %> <% yearArr.push(year); %> <% last = year; %>

<%= year %>

<%= date(post.date, config.date_format) %>

<%= post.title %>

<% } else { %>

<%= date(post.date, config.date_format) %>

<%= post.title %>

<% } %> <% }) %>