hexo-theme-amane/layout/widget/recent_posts.ejs

34 lines
1.5 KiB
Plaintext
Raw Normal View History

2016-02-02 16:19:44 +00:00
<% if (site.posts.length) { %>
2018-10-16 05:28:42 +00:00
<div class="card widget">
<div class="card-content">
<h3 class="menu-label">
<%= __('widget.recents') %>
</h3>
<% site.posts.sort('date', -1).limit(5).each(post => { %>
<article class="media">
<% if (!has_config('article.thumbnail') || get_config('article.thumbnail') !== false) { %>
2018-10-16 05:28:42 +00:00
<a href="<%- url_for((post.link?post.link:post.path)) %>" class="media-left">
<p class="image is-64x64">
<img class="thumbnail" src="<%= get_thumbnail(post) %>" alt="<%= post.title %>">
</p>
</a>
<% } %>
<div class="media-content">
<div class="content">
<div><time class="has-text-grey is-size-7 is-uppercase" datetime="<%= date_xml(post.date) %>"><%= date(post.date) %></time></div>
<a href="<%- url_for((post.link?post.link:post.path)) %>" class="has-link-black-ter is-size-6"><%= post.title %></a>
<p class="is-size-7 is-uppercase">
<%- list_categories(post.categories, {
show_count: false,
class: 'has-link-grey ',
depth:2,
style: 'none',
separator: '&nbsp;/&nbsp;'}) %>
</p>
</div>
</div>
</article>
<% }) %>
2016-02-02 16:19:44 +00:00
</div>
2018-10-16 05:28:42 +00:00
</div>
2016-02-02 16:19:44 +00:00
<% } %>