This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
mystic/themes/hueman/layout/widget/sticky_posts.ejs
2018-09-03 17:41:16 +10:00

25 lines
1.5 KiB
Plaintext

<% if (site.posts.length) { %>
<div class="widget-wrap">
<h3 class="widget-title"><%= __('sidebar.sticky') %></h3>
<div class="widget">
<ul id="recent-post" class="<%= (theme.customize.thumbnail?'':'no-thumbnail') %>">
<% site.posts.filter(function(post) { return post.sticky; }).sort('sticky', -1).limit(5).each(function(post) { %>
<% if (!post.hidden) { %>
<li>
<% if (theme.customize.thumbnail === true) { %>
<div class="item-thumbnail">
<%- partial('common/thumbnail.ejs', {post: post}) %>
</div>
<% } %>
<div class="item-inner">
<p class="item-category"><%- list_categories(post.categories, {show_count: false, depth:2, class: 'article-category', style: 'none', separator: '<i class="icon fa fa-angle-right"></i>'}) %></p>
<p class="item-title"><a href="<%- url_for((post.link?post.link:post.path)) %>" class="title"><%= post.title %></a></p>
<p class="item-date"><time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date) %></time></p>
</div>
</li>
<% } %>
<% }) %>
</ul>
</div>
</div>
<% } %>