add sidebar thumbnail option

pull/9/head
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 - tag
- tagcloud - tagcloud
- archive - archive
thumbnail: true
# Contacts # Contacts
contacts: contacts:

View File

@ -2,12 +2,14 @@
<div class="widget-wrap"> <div class="widget-wrap">
<h3 class="widget-title"><%= __('widget.recents') %></h3> <h3 class="widget-title"><%= __('widget.recents') %></h3>
<div class="widget"> <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){ %> <% site.posts.sort('date', -1).limit(5).each(function(post){ %>
<li> <li>
<% if(theme.thumbnail == true) { %>
<div class="item-thumbnail"> <div class="item-thumbnail">
<%- partial('../_partial/post/thumbnail.ejs', {post: post}) %> <%- partial('../_partial/post/thumbnail.ejs', {post: post}) %>
</div> </div>
<% } %>
<div class="item-inner"> <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-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> <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 li
clearfix() clearfix()
padding: 10px 0 10px 94px padding: 10px 0 10px 94px
&.no-thumbnail
li
padding: 10px 0px
li
.item-thumbnail .item-thumbnail
opacity: 1 opacity: 1
float: left float: left