This is the 17th day of my participation in the August Challenge

When using the Theme nextV7.7.1, the native statistics of next will become invalid after adding live2D kanban in hexo. This article describes how to fix the problem.

Problem of repetition

Turn on the next theme.

# 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
Copy the code

Install live2D plugin:

npm install --save hexo-helper-live2d
Copy the code

Problems arise:

Fix the bug

Method 1. Uninstall Livd2D

Uninstalling Live2D fixes the problem:

npm uninstall --save hexo-helper-live2d
Copy the code

Method 2. Add garlic seeds manually

How can kanban niang unload ????? Absolutely not acceptable!!

  • Close next native non-garlic seed
# Show Views / Visitors of the website / page with busuanzi.
# Get more information on http://ibruce.info/2015/04/04/busuanzi
busuanzi_count:
  enable: false
  total_visitors: true
  total_visitors_icon: user
  total_views: true
  total_views_icon: eye
  post_views: true
  post_views_icon: eye
Copy the code

Repair the total number of home page statistics

  • inHexo root directoryModify footer.swig in the /themes/next/layout/_partials/ folder and add the code before the last line:
< script async SRC = "/ / busuanzi. Ibruce. Info/busuanzi / 2.3 / busuanzi. Pure. The mini. Js" > < / script > < span > < br > < / span > < span Class ="post-meta-item-icon"> < I class="fa fa-group"></ I ></ span> <span> Total visitors & NBSP <span Id = "busuanzi_value_site_uv" > < / span > & NBSP people < / span > < span class = "post - meta - divider" > | < / span > < span Class ="post-meta-item-icon"> < I class="fa fa-eye"></ I ></ span> <span> Total access & NBSP <span Id = "busuanzi_value_site_pv" > < / span > < / span > & NBSP times {{- next_inject (' footer ')}}Copy the code

Effect:

Fixed article statistics

You can replace the statistics function by turning on the visitor switch in the topic profile – Valine comments.

valine:
  enable: true
  ...
  visitor: true # Article reading statistic
Copy the code

To start Valine, refer to next-6 – Add Valine comment system