From 5abf99965781f7415f633b1ad2670ab5c41924f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=93=E5=8F=91=E5=8F=97=E9=95=BF=E7=94=9F?= Date: Thu, 7 Jun 2018 00:18:33 +0800 Subject: [PATCH] =?UTF-8?q?gitalk=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/yilia/_config.yml | 17 ++++++++------- themes/yilia/layout/_partial/after-footer.ejs | 21 +++++++++++++++++-- themes/yilia/layout/_partial/article.ejs | 8 ++----- themes/yilia/layout/_partial/footer.ejs | 2 +- themes/yilia/layout/_partial/post/gitment.ejs | 16 -------------- themes/yilia/layout/_partial/script.ejs | 2 +- themes/yilia/layout/layout.ejs | 2 +- themes/yilia/package-lock.json | 5 ----- themes/yilia/package.json | 3 +-- themes/yilia/source-src/css/mobile.scss | 4 +--- themes/yilia/source-src/js/viewer.js | 3 ++- themes/yilia/source-src/script.ejs | 2 +- 12 files changed, 39 insertions(+), 46 deletions(-) delete mode 100644 themes/yilia/layout/_partial/post/gitment.ejs diff --git a/themes/yilia/_config.yml b/themes/yilia/_config.yml index 4523cf1..6da0176 100644 --- a/themes/yilia/_config.yml +++ b/themes/yilia/_config.yml @@ -51,7 +51,7 @@ weixin: # 目录 # 目录设定:0-不显示目录; 1-文章对应的md文件里有toc:true属性,才有目录; 2-所有文章均显示目录 -toc: 1 +toc: 2 # 根据自己的习惯来设置,如果你的目录标题习惯有标号,置为true即可隐藏hexo重复的序号;否则置为false toc_hide_index: true # 目录为空时的提示 @@ -88,12 +88,15 @@ changyan_conf: false #4、Disqus 在hexo根目录的config里也有disqus_shortname字段,优先使用yilia的 disqus: false -#5、Gitment -gitment_owner: sookie2010 #你的 GitHub ID -gitment_repo: hexo_blog #存储评论的 repo -gitment_oauth: - client_id: 90e8f648da2a669f7975 - client_secret: 7d2b602616387748ef0df10f7a8a626bdfd1034c +#5、gitalk +gitalk: + enable: true + ClientID: bede8dd783185299d256 + ClientSecret: 91eaf4bf12a203793e3096aea07837812de32350 + repo: hexo_blog + githubID: sookie2010 + adminUser: sookie2010 + distractionFreeMode: false # 样式定制 - 一般不需要修改,除非有很强的定制欲望… style: diff --git a/themes/yilia/layout/_partial/after-footer.ejs b/themes/yilia/layout/_partial/after-footer.ejs index 3a4c6a7..39edf54 100644 --- a/themes/yilia/layout/_partial/after-footer.ejs +++ b/themes/yilia/layout/_partial/after-footer.ejs @@ -1,5 +1,5 @@ -<%- partial('script') %> \ No newline at end of file +<%- partial('script') %> +<% if(theme.gitalk.enable && is_post()) { %> + + + +<% } %> \ No newline at end of file diff --git a/themes/yilia/layout/_partial/article.ejs b/themes/yilia/layout/_partial/article.ejs index 3722a8f..4fee213 100644 --- a/themes/yilia/layout/_partial/article.ejs +++ b/themes/yilia/layout/_partial/article.ejs @@ -122,11 +122,7 @@ <% } %> - <% if (theme.gitment_owner && theme.gitment_repo &&theme.gitment_oauth && theme.gitment_oauth.client_id && theme.gitment_oauth.client_secret){ %> - <%- partial('post/gitment', { - key: post.slug, - title: post.title, - url: config.url+url_for(post.path) - }) %> + <% if(theme.gitalk.enable){ %> +
<% } %> <% } %> diff --git a/themes/yilia/layout/_partial/footer.ejs b/themes/yilia/layout/_partial/footer.ejs index 8d489d1..ca792a6 100644 --- a/themes/yilia/layout/_partial/footer.ejs +++ b/themes/yilia/layout/_partial/footer.ejs @@ -5,7 +5,7 @@ © <%= date(new Date(), 'YYYY') %> <%= config.author || config.title %> diff --git a/themes/yilia/layout/_partial/post/gitment.ejs b/themes/yilia/layout/_partial/post/gitment.ejs deleted file mode 100644 index 104a8fe..0000000 --- a/themes/yilia/layout/_partial/post/gitment.ejs +++ /dev/null @@ -1,16 +0,0 @@ -
- - - \ No newline at end of file diff --git a/themes/yilia/layout/_partial/script.ejs b/themes/yilia/layout/_partial/script.ejs index 9b11d53..82530be 100644 --- a/themes/yilia/layout/_partial/script.ejs +++ b/themes/yilia/layout/_partial/script.ejs @@ -1 +1 @@ -<%- js('js/mobile.bc3ac97a4b2208729e1e.js') %> <%- js('js/slider.aa150152ad0b4e146925.js') %> <%- js('js/main.f26f0d0b8a2e2ae348ae.js') %> \ No newline at end of file +<%- js('js/mobile.04379a910e1ff32f2a41.js') %> <%- js('js/slider.a725c75e59c2eeae98e0.js') %> <%- js('js/main.254cebd259c4777bdd2e.js') %> \ No newline at end of file diff --git a/themes/yilia/layout/layout.ejs b/themes/yilia/layout/layout.ejs index 43a8d4a..5d4fa32 100644 --- a/themes/yilia/layout/layout.ejs +++ b/themes/yilia/layout/layout.ejs @@ -10,7 +10,7 @@