在Hexo最新的Next主题中已经集成了valine和busuanzi_count,我们只需要修改配置文件启用这些插件就可以了。
启用busuanzi_count
打开博客目录下的themes\next_config.yml文件,把busuanzi_countd中enable的值false改为true就可以完成配置了
busuanzi_count:
enable: true
total_visitors: true
total_visitors_icon: user
total_views: true
total_views_icon: eye
post_views: true
post_views_icon: eye
启用valine
想要使用Valine插件我们需要注册一个Leancloud账号。
Leancloud提供体验版服务,对于小型博客来说暂时是够用了。
数据存储 |
---|
总请求数不超过每日 30,000 次 |
云端并发线程数低于 3 个 |
免费赠送 1 GB 对象存储 |
无自动备份 |
注册完之后创建一个应用,进到设置 -> 应用Keys 记下你的AppID和AppKey。
打开博客目录下的themes\next_config.yml文件
找到valine的配置,填上appid和appkey然后把enable的值false改为true就可以完成配置了
valine:
enable: false # 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 leancloud application appid
appkey: # 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
recordIP: false # Whether to record the commenter IP
serverURLs: # When the custom domain name is enabled, fill it in here (it will be detected automatically by default, no need to fill in)
#post_meta_order: 0