2018-06-04 17:31:48 +08:00

23 lines
541 B
Plaintext

<% if (site.posts.length){ %>
<%
var extraClass = '';
if (idx.current % 3 === 0) {
extraClass += ' first';
if (idx.current >= 3) {
extraClass += ' newline';
}
}
%>
<div class="widget recent-posts<%= extraClass %>">
<h3 class="title"><%= __('recent_posts') %></h3>
<ul class="entry">
<% site.posts.sort('date', -1).limit(5).each(function(post){ %>
<li>
<a href="<%= config.root %><%= post.path %>"><%= post.title %></a>
</li>
<% }); %>
</ul>
</div>
<% } else {
idx.current -= 1
} %>