Hexo配置busuanzi统计插件

Next主题为5.x版本,直接在配置文件中配置。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Show PV/UV of the website/page with busuanzi.
# Get more information on http://ibruce.info/2015/04/04/busuanzi/
busuanzi_count:
# count values only if the other configs are false
enable: true
# custom uv span for the whole site
site_uv: true
site_uv_header: <i class="fa fa-user"></i>
site_uv_footer: 人次
# custom pv span for the whole site
site_pv: true
site_pv_header: <i class="fa fa-eye"></i>
site_pv_footer: 次
# custom pv span for one page only
page_pv: true
page_pv_header: <i class="fa fa-file-o"></i>
page_pv_footer: 次

Busuanzi网站统计失效问题

由于 busuanzi(不蒜子) 的域名更新,导致了使用 Hexo Next 主题时统计数据失效。不蒜子的域名由原来的 dn-lbstatics.qbox.me 更换为了 busuanzi.ibruce.info。

解决办法

  • 到 hexo 的 themes 文件夹下, 进入 \themes\next\layout_third-party\analytics 目录
  • 打开 busuanzi-counter.swig
  • src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js" 修改为 src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"
  • hexo g
  • hexo d