hexo theme

hexo开启评论

jackman主题支持的多说和网易云跟帖评论系统已经下线,网上搜索,valine评论系统评价非常高。

next主题自带valine评论系统,在leancloud:https://leancloud.cn 注册,然后在主题中配置:

valine:
  enable: true # When enable is set to be true, leancloud_visitors is recommended to be closed for the re-initialization problem within different leancloud adk version.
  appid:  your id # your leancloud application appid
  appkey: your key  # your leancloud application appkey
  notify: false # mail notifier, See: https://github.com/xCss/Valine/wiki
  verify: false # Verification code
  placeholder: Just go go # comment box placeholder
  avatar: mm # gravatar style
  guest_info: nick,mail,link # custom comment header
  pageSize: 10 # pagination size
  language: zh-cn # language, available values: en, zh-cn
  visitor: false # leancloud-counter-security is not supported for now. When visitor is set to be true, appid and appkey are recommended to be the same as leancloud_visitors' for counter compatibility. Article reading statistic https://valine.js.org/visitor.html
  comment_count: true # if false, comment count will only be displayed in post page, not in home page

页面单独使用系统

当不使用hexo,一个独立的页面想使用评论系统,可参考如下方式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Valine - A simple comment system based on Leancloud.</title>
<!--Leancloud 操作库:-->
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<!--Valine 的核心代码库:-->
<script src="./dist/Valine.min.js"></script>
</head>
<body>
<div class="comment"></div>
<script>
new Valine({
// AV 对象来自上面引入av-min.js(老司机们不要开车➳♡゛扎心了老铁)
av: AV,
el: '.comment', //
app_id: 'Your APP ID', // 这里填写上面得到的APP ID
app_key: 'Your APP KEY', // 这里填写上面得到的APP KEY
placeholder: 'ヾノ≧∀≦)o来啊,快活啊!' // [v1.0.7 new]留言框占位提示文字
});
</script>
</body>
</html>

插播一下,关于评论数据管理,请自行登录Leancloud应用管理。
具体步骤:登录>选择你创建的应用>存储>选择ClassComment,然后就可以尽情的发挥你的权利啦(~ ̄▽ ̄)~

显示摘要

在正文中使用”<!”– more –”>”即可(两个<>之间的引号不要)

参考博客

http://gisersqdai.top/2017/11/24/hexo%E5%8D%9A%E5%AE%A2%E8%AF%84%E8%AE%BA%E6%96%B0%E7%A5%9E%E5%99%A8%E2%80%94%E2%80%94Valine/
https://ioliu.cn/2017/add-valine-comments-to-your-blog/

使用next
jackman添加评论系统:https://www.jianshu.com/p/3ae745272791