Hexo Next主题添加访客统计、访问次数统计、文章阅读次数统计

Hexo的版本:v3.9.0
Next的版本:v7.4.0

1、打开next主题配置文件\themes\next_config.yml,搜索找到busuanzi_count,把enable设置为true

# Show Views / Visitors of the website / page with busuanzi.#展示访问数
# Get more information on http://ibruce.info/2015/04/04/busuanzi
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

2、同样是在next主题配置文件\themes\next_config.yml下,搜索footer,在它底下添加counter,设值为true

  #统计
  counter: true

3、来到themes\next\layout_partials,找到footer.swig文件,打开编辑,在底下添加代码

{% if theme.footer.counter %}
    <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
{% endif %}

4、https://sweetolive.github.io/ 效果图:
站点访客数、访问次数显示在网址底部
在这里插入图片描述
文章阅读次数在文章开头
在这里插入图片描述

https://sweetolive.github.io/

发布了81 篇原创文章 · 获赞 8 · 访问量 9566

猜你喜欢

转载自blog.csdn.net/baidu_34310405/article/details/102665373