add sidebar thumbnail option
parent
234771d06c
commit
a8442f2447
|
@ -16,6 +16,7 @@ widgets:
|
||||||
- tag
|
- tag
|
||||||
- tagcloud
|
- tagcloud
|
||||||
- archive
|
- archive
|
||||||
|
thumbnail: true
|
||||||
|
|
||||||
# Contacts
|
# Contacts
|
||||||
contacts:
|
contacts:
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue