add sidebar thumbnail option

This commit is contained in:
ppoffice 2015-04-05 16:05:08 +08:00
parent 234771d06c
commit a8442f2447
3 changed files with 8 additions and 1 deletions

View File

@ -16,6 +16,7 @@ widgets:
- tag
- tagcloud
- archive
thumbnail: true
# Contacts
contacts:

View File

@ -2,12 +2,14 @@
<div class="widget-wrap">
<h3 class="widget-title"><%= __('widget.recents') %></h3>
<div class="widget">
<ul id="recent-post">
<ul id="recent-post" class="<%= (theme.thumbnail?'':'no-thumbnail') %>">
<% site.posts.sort('date', -1).limit(5).each(function(post){ %>
<li>
<% if(theme.thumbnail == true) { %>
<div class="item-thumbnail">
<%- partial('../_partial/post/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="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>

View File

@ -110,6 +110,10 @@
li
clearfix()
padding: 10px 0 10px 94px
&.no-thumbnail
li
padding: 10px 0px
li
.item-thumbnail
opacity: 1
float: left