From a8442f24475f4f3409e270ed0a7431c0845f7871 Mon Sep 17 00:00:00 2001 From: ppoffice Date: Sun, 5 Apr 2015 16:05:08 +0800 Subject: [PATCH] add sidebar thumbnail option --- _config.yml.example | 1 + layout/_widget/recent_posts.ejs | 4 +++- source/css/_partial/sidebar.styl | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/_config.yml.example b/_config.yml.example index 1af241f..abaf830 100644 --- a/_config.yml.example +++ b/_config.yml.example @@ -16,6 +16,7 @@ widgets: - tag - tagcloud - archive +thumbnail: true # Contacts contacts: diff --git a/layout/_widget/recent_posts.ejs b/layout/_widget/recent_posts.ejs index e89e845..8373c43 100644 --- a/layout/_widget/recent_posts.ejs +++ b/layout/_widget/recent_posts.ejs @@ -2,12 +2,14 @@

<%= __('widget.recents') %>

-
    +
      <% site.posts.sort('date', -1).limit(5).each(function(post){ %>
    • + <% if(theme.thumbnail == true) { %>
      <%- partial('../_partial/post/thumbnail.ejs', {post: post}) %>
      + <% } %>

      <%- list_categories(post.categories, {show_count: false, depth:2, class: 'article-category', style: 'none', separator: ''}) %>

      <%= post.title %>

      diff --git a/source/css/_partial/sidebar.styl b/source/css/_partial/sidebar.styl index 7454748..3a1dc28 100644 --- a/source/css/_partial/sidebar.styl +++ b/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