Next 之 Leancloud 访客统计 v6.6.0 配置

前因

版本:NexT.Pisces v6.6.0
Error: 阅读次数:Counter not initialized! See more at console err msg.

解决

出现上述之错误,遂查看配置文件之说明

1
2
3
4
5
6
7
8
9
10
11
# Show number of visitors to each article.
# You can visit https://leancloud.cn get AppID and AppKey.
leancloud_visitors:
enable: true
app_id: <<your app id>>
app_key: <<your app key>>
# Dependencies: https://github.com/theme-next/hexo-leancloud-counter-security
# If you don't care about security in lc counter and just want to use it directly
# (without hexo-leancloud-counter-security plugin), set the `security` to `false`.
security: true
betterPerformance: false

如上述两个解决办法:

  1. 安装 hexo-leancloud-counter-security 并设置 leancloudapp_idapp_key

  2. security 设置为 security: false

因为懒所以选择了第二方案。