ppoffice 10 лет назад
Родитель
Сommit
a8442f2447
3 измененных файлов с 8 добавлено и 1 удалено
  1. 1 0
      _config.yml.example
  2. 3 1
      layout/_widget/recent_posts.ejs
  3. 4 0
      source/css/_partial/sidebar.styl

+ 1 - 0
_config.yml.example

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

+ 3 - 1
layout/_widget/recent_posts.ejs

@@ -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>

+ 4 - 0
source/css/_partial/sidebar.styl

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