saturneric.github.io/themes/landscape/layout/_widget/recent_posts.ejs

14 lines
399 B
Plaintext
Raw Normal View History

2019-10-08 19:06:22 +00:00
<% if (site.posts.length){ %>
<div class="widget-wrap">
<h3 class="widget-title"><%= __('recent_posts') %></h3>
<div class="widget">
<ul>
<% site.posts.sort('date', -1).limit(5).each(function(post){ %>
<li>
<a href="<%- url_for(post.path) %>"><%= post.title || '(no title)' %></a>
</li>
<% }) %>
</ul>
</div>
</div>
<% } %>