Linux uses github + hexo build personal blog 06-next topic under the Access statistics

 

He said before the next theme of optimizing access and comment system. Let us finish the page layout and style of their own needs, but also allows users to access any post comments, bloggers and complete access to the user's interaction.

In this chapter we continue to explain other important functions.

Since it is a web site, then we need to collect data access website providing traffic trends, source analysis, conversion tracking heat map page to access streaming and other statistical analysis services; then we need to introduce - Baidu statistics.

The above statistics can only be viewed in Baidu statistics, but I want to be able to directly look at some simple data pages in their website. For example: the number of site visits, number of visits, number of visits to each article, the site total number of words, number of words per article, such as estimates long time to read. Then we can introduce without garlic statistics, word count, number of read statistics. See it below the concrete.

Baidu statistics

Baidu statistics need to be registered in, and get the ID of the script.

 

After the theme configuration file modification.

1 [root@iZ28xbsfvc4Z next]# pwd  # 主题目录
2 /app/softinsall/hexo/themes/next
3 [root@iZ28xbsfvc4Z next]# vim _config.yml 
4 # Baidu Analytics ID
5 baidu_analytics: 983XXXXXXXXXXXXXXXXXXXXXXXXXX2

 

Access Report Viewer

Half an hour or an hour or so to see the report in Baidu statistics.

 

No garlic Statistics

Edit theme configuration file configuration items busuanzi_count in.

 1 [root@iZ28xbsfvc4Z next]# pwd  # 主题目录
 2 /app/softinsall/hexo/themes/next
 3 [root@iZ28xbsfvc4Z next]# vim _config.yml 
 4 # Show PV/UV of the website/page with busuanzi.
 5 # Get more information on http://ibruce.info/2015/04/04/busuanzi/
 6 busuanzi_count:
 7   # count values only if the other configs are false
 8   enable: true
 9   # custom uv span for the whole site
10   site_uv: true
11   site_uv_header: the number of visitors to the site
 12    site_uv_footer: Visitors
 13    # Custom pv span for at The Whole Site
 14    site_pv: to true 
15    site_pv_header: Total visits the site
 16    site_pv_footer: times
 17    # Custom pv span for One Page only  
 18    # to read any post frequency use leancloud statistics. The reason is that "Home" in, leancloud statistics can also see the number of read without garlic is not.
19    page_pv: false 
20    page_pv_header: the total amount of reading article
 21    page_pv_footer: times

 

Garlic does not modify the subdomain

Because seven cattle forced expired "dn-lbstatics.qbox.me" domain names, communicate with customer service to no avail, only to replace the domain name "busuanzi.ibruce.info"!

amend as below:

1 [root@iZ28xbsfvc4Z next]# pwd  # 主题目录
2 /app/softinsall/hexo/themes/next
3 [root@iZ28xbsfvc4Z next]# vim layout/_third-party/analytics/busuanzi-counter.swig  
4 {% if theme.busuanzi_count.enable %}
5 <div class="busuanzi-count">
6   <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
7 ………………

 

Browser access

Bottom of the page

 

Views statistics

Create a Class in the LeanCloud

Before commenting system has been created to explain the LeanCloud account, application creation, access to App ID and App Key security has been reinforced. Class times create only read here explaining to do.

Data column, _ the beginning of the system are pre-defined tables.

In order to distinguish a new table to hold the data. In order to ensure that changes to the NexT theme compatibility, the new name must be Class Counter . In order to avoid problems caused authority statistics show that the number of abnormal, select Unlimited , to create Class.

 

Theme configuration changes

In the theme configuration file modifications:

1 [root@iZ28xbsfvc4Z next]# pwd  # 主题目录
2 /app/softinsall/hexo/themes/next
3 [root@iZ28xbsfvc4Z next]# vim _config.yml 
4 # Show number of visitors to each article.
5 # You can visit https://leancloud.cn get AppID and AppKey.
6 leancloud_visitors:
7   enable: true
8   app_id: h7YmXXXXXXXXXXXXXX
9   app_key: VhTGXXXXXXXXXX

 

Browser access

Article Title

 

Count

A word count of the article and analyze the reading time.

Wordcount plug-in installation

You need to install plug-ins

1 [root@iZ28xbsfvc4Z hexo]# pwd  # 站点目录
2 /app/softinsall/hexo
3 [root@iZ28xbsfvc4Z hexo]# npm install hexo-wordcount --save

 

Theme configuration changes

In the theme configuration file modification.

1 [root @ iZ28xbsfvc4Z the Next] # pwd   # theme directory
 2 / App / softinsall / HEXO / Themes / the Next
 3  [root @ iZ28xbsfvc4Z the Next] vim _config.yml # 
 4  # Post wordcount Run the display Settings
 5 # the Dependencies: HTTPS: // GitHub .com / Willin / HEXO-wordcount 
6  post_wordcount:
 7    item_text: to true   # text display
 8    wordcount: to true   # single article word count
 9    min2read: to true    long-# single article read
 10    TotalCount: to true   # site count
 11    # the post_wordcount all set a separate row
12    separated_meta: to true 
13 [root @ iZ28xbsfvc4Z the Next] # vim languages / en-US Hans.yml replaced by Chinese from English #
 14    TotalCount: Powered total number of words

 

Browser access

Article Title

 

Bottom of the page

 

Recommended Reading

Under Linux use github + hexo build a personal blog to build a 01-hexo

Linux uses github + hexo build a personal blog under the 02-hexo deployed to Github Pages

Linux uses github + hexo build personal blog 03-hexo Configuration Optimization

Use github + hexo build personal blog 04-next topic optimization under Linux

Linux uses github + hexo build personal blog 05-next topic access system under review

Linux uses github + hexo build personal blog 06-next topic under the Access statistics

Linux uses github + hexo build personal blog 07-next topic search and access management at the site

 


 

Guess you like

Origin www.cnblogs.com/zhanglianghhh/p/11275220.html