Add: valine 评论系统,优化 article-post 页面样式

This commit is contained in:
XPoet 2020-03-19 14:51:48 +08:00
parent 9df3584fec
commit 00b471ed4a
7 changed files with 63 additions and 46 deletions

View File

@ -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
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: 评论一下再走吧~

View File

@ -4,10 +4,7 @@
<div class="post-title">
<h3><a><%= page.title %></a></h3>
</div>
<div class="post-content">
<%- page.content %>
</div>
<div class="post-footer">
<div class="post-meta-info">
<div class="meta">
<div class="info">
<span>
@ -28,6 +25,9 @@
</div>
</div>
</div>
<div class="post-content">
<%- page.content %>
</div>
<div class="comment-container">
<%- partial('valine') %>
</div>

View File

@ -11,7 +11,8 @@
</div>
<div class="article-post-content">
<%- post.content %>
<!-- truncate() 移除超过 length 长度的字符串。length 的默认值是 30。 -->
<%- truncate(strip_html(post.content), {length: 80}) %>
</div>
<div class="article-post-meta">

View File

@ -1,12 +1,14 @@
<script src='https://unpkg.com/valine@1.3.10/dist/Valine.min.js'></script>
<div id="valine"></div>
<script>
new Valine({
el: '#valine',
appId: 'XXX',
appKey: 'XXX',
notify: true,
verify: false,
placeholder: '评论一下再走吧'
})
</script>
<% if(theme.valine.enable && theme.valine.appid && theme.valine.appkey) { %>
<script src='https://unpkg.com/valine@1.3.10/dist/Valine.min.js'></script>
<div id="valine"></div>
<script>
new Valine({
el: '#valine',
appId: '<%= theme.valine.appid %>',
appKey: '<%= theme.valine.appkey %>',
notify: '<%= theme.valine.notify %>',
verify: '<%= theme.valine.verify %>',
placeholder: '<%= theme.valine.placeholder %>'
})
</script>
<% } %>

View File

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

View File

@ -52,6 +52,7 @@
.article-post-content {
padding 15px 0
a {
text-decoration: none;
letter-spacing: 1px;

View File

@ -6,7 +6,7 @@
padding 2px
border-radius 50%
border 1px solid #ddd
width: 40%;
width: 150px;
}