From 146f4b3e7f477b7aa723b3cea1fd54e20cc54592 Mon Sep 17 00:00:00 2001 From: Liu Yiding Date: Wed, 3 Dec 2014 14:42:39 +0800 Subject: [PATCH 1/3] 1. modify widget/links, you can define links in `_config.yml` 2. add widget/comment, it will show the latest comments of duoshuo 3. linkedin icon in footer can be display right now --- CHANGELOG.md | 4 ++++ _config.yml | 15 +++++++++++++-- languages/default.yml | 1 + languages/zh-CN.yml | 3 ++- languages/zh-TW.yml | 3 ++- layout/_widget/comment.ejs | 18 ++++++++++++++++++ layout/_widget/links.ejs | 7 +++++-- source/css/_partial/aside.styl | 29 +++++++++++++++++++++++++++++ source/css/_partial/footer.styl | 2 +- 9 files changed, 75 insertions(+), 7 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 layout/_widget/comment.ejs diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a4ad05f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +# 20141203 +1. modify widget/links, you can define links in `_config.yml` +2. add widget/comment, it will show the latest comments of duoshuo +3. linkedin icon in footer can be display right now diff --git a/_config.yml b/_config.yml index a8df369..3df4f4f 100644 --- a/_config.yml +++ b/_config.yml @@ -14,8 +14,10 @@ widgets: - category - tag - rss -## provide six widgets:category,tag,rss,archive,tagcloud,links. -## modify links in `/layout/_widget/links.ejs`. +- comment +- links +## provide seven widgets:category,tag,rss,archive,tagcloud,links,comment. +## modify links in `_config.yml` #### RSS rss: ## RSS address. @@ -96,3 +98,12 @@ google_cse: ## title: search ## --- +## for friendly links +links: +- url: http://github.com + name: github + title: a free code repository +- url: http://hexo.io + name: hexo + title: a free blog generator + diff --git a/languages/default.yml b/languages/default.yml index f220330..3c29761 100644 --- a/languages/default.yml +++ b/languages/default.yml @@ -16,3 +16,4 @@ rss: RSS showsidebar: "Show Sidebar" hidesidebar: "Hide Sidebar" updated: Updated +comments: "Latest Comments" diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index bf0b4df..d0a0ad2 100644 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -15,4 +15,5 @@ links: 友情链接 rss: RSS 订阅 showsidebar: 显示侧边栏 hidesidebar: 隐藏侧边栏 -updated: 更新日期 \ No newline at end of file +updated: 更新日期 +comments: 最新评论 diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index 18e78e5..2e9b3d2 100644 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -15,4 +15,5 @@ links: 友情鏈接 rss: RSS 訂閱 showsidebar: 顯示側邊欄 hidesidebar: 隱藏側邊欄 -updated: 更新日期 \ No newline at end of file +updated: 更新日期 +comments: 最新評論 diff --git a/layout/_widget/comment.ejs b/layout/_widget/comment.ejs new file mode 100644 index 0000000..23309ab --- /dev/null +++ b/layout/_widget/comment.ejs @@ -0,0 +1,18 @@ +<% if (theme.duoshuo.enable && theme.duoshuo.short_name.length) { %> +
+

<%= __('comments') %>

+ +
+ + + +<% } %> diff --git a/layout/_widget/links.ejs b/layout/_widget/links.ejs index 3682af1..3c00546 100644 --- a/layout/_widget/links.ejs +++ b/layout/_widget/links.ejs @@ -1,7 +1,10 @@ +<% if (theme.links && theme.links.length) { %> +<% } %> diff --git a/source/css/_partial/aside.styl b/source/css/_partial/aside.styl index 07e78bc..4d17340 100644 --- a/source/css/_partial/aside.styl +++ b/source/css/_partial/aside.styl @@ -199,3 +199,32 @@ color color-theme transition color .25s +//comments +.commentslist + margin-top 0.5em + @media mini + width 45% + float left + margin 0 5% 0 0 + @media tablet + width 100% + float none + margin 1em 0 0 + ul + padding 0.5em 0 + a + font-size 1em + line-height line-height + display block + padding 0 + &:hover + color color-theme + transition color .25s + +.ds-excerpt + font-size 1.1em + color color-theme + +.ds-recent-comments + margin-top -0.6em + margin-left 0.3em diff --git a/source/css/_partial/footer.styl b/source/css/_partial/footer.styl index 572db51..890cb4d 100644 --- a/source/css/_partial/footer.styl +++ b/source/css/_partial/footer.styl @@ -72,7 +72,7 @@ footer @media mini width 18em position absolute - right -3em + right -1em top 3em a float left From 07f265e493380887b20567d51a139bcc4ee8c887 Mon Sep 17 00:00:00 2001 From: Liu Yiding Date: Mon, 9 Nov 2015 11:56:02 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=99=BE=E5=BA=A6?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 4 ++++ layout/_partial/head.ejs | 1 + 2 files changed, 5 insertions(+) diff --git a/_config.yml b/_config.yml index 3df4f4f..2546a42 100644 --- a/_config.yml +++ b/_config.yml @@ -107,3 +107,7 @@ links: name: hexo title: a free blog generator +# 百度统计 +baidu_tongji: + enable: false ##使用百度统计就设置为true + key: ##百度统计代码中//hm.baidu.com/hm.js?后面的那串id diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 9cbc17a..44805af 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -52,4 +52,5 @@ <% } %> <%- css('css/style') %> + <%- partial('baidu_tongji') %> From 7eea528ecc3f56aa2f79ef9ce7b0cd69d180a420 Mon Sep 17 00:00:00 2001 From: Liu Yiding Date: Mon, 9 Nov 2015 12:33:46 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9B=BE=E7=89=87alt=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E6=88=90=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 补上百度统计文件 2. 增加图片链接渲染 --- layout/_partial/after_footer.ejs | 23 ++++++++++++++++++++++- layout/_partial/baidu_tongji.ejs | 11 +++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 layout/_partial/baidu_tongji.ejs diff --git a/layout/_partial/after_footer.ejs b/layout/_partial/after_footer.ejs index 3cc0900..cb705b0 100644 --- a/layout/_partial/after_footer.ejs +++ b/layout/_partial/after_footer.ejs @@ -158,7 +158,28 @@ $(document).ready(function(){ if($.fancybox){ $('.fancybox').fancybox(); } -}); +}); <% } %> + <%- partial('google_analytics') %> diff --git a/layout/_partial/baidu_tongji.ejs b/layout/_partial/baidu_tongji.ejs new file mode 100644 index 0000000..05ffcc3 --- /dev/null +++ b/layout/_partial/baidu_tongji.ejs @@ -0,0 +1,11 @@ +<% if (theme.baidu_tongji && theme.baidu_tongji.enable) { %> + +<% } %>