From 00b471ed4a11cf1849903cabb6a3cd22286e6467 Mon Sep 17 00:00:00 2001 From: XPoet Date: Thu, 19 Mar 2020 14:51:48 +0800 Subject: [PATCH] =?UTF-8?q?Add:=20valine=20=E8=AF=84=E8=AE=BA=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=EF=BC=8C=E4=BC=98=E5=8C=96=20article-post=20=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 13 ++++++- layout/common/article-post.ejs | 8 ++--- layout/common/home-post.ejs | 3 +- layout/common/valine.ejs | 26 +++++++------- source/css/common/article-post.styl | 56 +++++++++++++++-------------- source/css/common/home-post.styl | 1 + source/css/common/site-info.styl | 2 +- 7 files changed, 63 insertions(+), 46 deletions(-) diff --git a/_config.yml b/_config.yml index 793ac16..ca9693c 100644 --- a/_config.yml +++ b/_config.yml @@ -13,4 +13,15 @@ avatar: images/favicon.png # Available value: # normal | night | night eighties | night blue | night bright # https://github.com/chriskempson/tomorrow-theme -highlight_theme: normal \ No newline at end of file +highlight_theme: normal + +# Valine. +# You can get your appid and appkey from https://leancloud.cn +# more info please open https://github.com/xCss/Valine +valine: + enable: true + appid: ih2nzG3ilVNdLgJK4kBXTjOq-gzGzoHsz # your leancloud application appid + appkey: gdf6tXXLBTLg9qpjS2y6Tbw7 # your leancloud application appkey + notify: false # mail notifier , https://github.com/xCss/Valine/wiki + verify: false # Verification code + placeholder: 评论一下再走吧~ \ No newline at end of file diff --git a/layout/common/article-post.ejs b/layout/common/article-post.ejs index acaca18..36cc268 100644 --- a/layout/common/article-post.ejs +++ b/layout/common/article-post.ejs @@ -4,10 +4,7 @@

<%= page.title %>

-
- <%- page.content %> -
-
+ +
+ <%- page.content %> +
<%- partial('valine') %>
diff --git a/layout/common/home-post.ejs b/layout/common/home-post.ejs index 3e5df4c..9942ab1 100644 --- a/layout/common/home-post.ejs +++ b/layout/common/home-post.ejs @@ -11,7 +11,8 @@
- <%- post.content %> + + <%- truncate(strip_html(post.content), {length: 80}) %>
diff --git a/layout/common/valine.ejs b/layout/common/valine.ejs index 7597b09..997669d 100755 --- a/layout/common/valine.ejs +++ b/layout/common/valine.ejs @@ -1,12 +1,14 @@ - -
- \ No newline at end of file +<% if(theme.valine.enable && theme.valine.appid && theme.valine.appkey) { %> + +
+ +<% } %> diff --git a/source/css/common/article-post.styl b/source/css/common/article-post.styl index a45667f..21a22c1 100644 --- a/source/css/common/article-post.styl +++ b/source/css/common/article-post.styl @@ -43,34 +43,9 @@ } } - .post-content { - a { - text-decoration: none; - letter-spacing: 1px; - color: #4786D6; - } - - a:hover { - color: #2F69B3; - } - - h3 { - color: #5F5F5F; - font-size: 22px; - font-weight: 600; - } - - h4 { - color: #5F5F5F; - font-size: 16px; - } - } - - - .post-footer { - padding: 0 0 30px 0; - border-bottom: 1px solid #f2f2f2; + .post-meta-info { + margin-top: 20px; .meta { max-width: 100%; @@ -133,4 +108,31 @@ } + .post-content { + + padding-bottom 10px + + a { + text-decoration: none; + letter-spacing: 1px; + color: #4786D6; + } + + a:hover { + color: #2F69B3; + } + + h3 { + color: #5F5F5F; + font-size: 22px; + font-weight: 600; + } + + h4 { + color: #5F5F5F; + font-size: 16px; + } + } + + } diff --git a/source/css/common/home-post.styl b/source/css/common/home-post.styl index 0182e32..db6d3ee 100644 --- a/source/css/common/home-post.styl +++ b/source/css/common/home-post.styl @@ -52,6 +52,7 @@ .article-post-content { + padding 15px 0 a { text-decoration: none; letter-spacing: 1px; diff --git a/source/css/common/site-info.styl b/source/css/common/site-info.styl index 504d9bf..ade6004 100644 --- a/source/css/common/site-info.styl +++ b/source/css/common/site-info.styl @@ -6,7 +6,7 @@ padding 2px border-radius 50% border 1px solid #ddd - width: 40%; + width: 150px; }