Build your own technology blog series (five) hexo blog access busuanzi plug-ins, display traffic and website uptime

busuanzi count script

Here Insert Picture Description

busuanzi official guidelines

First, the installation script (Required)

To use no garlic busuanzi.js must be introduced in the page, the latest version is as follows.

Garlic can not give any type of personal use of the site, if you are using hexo, open themes / your theme /layout/_partial/footer.ejs adding the script can, of course, you can also be added to the header.

Second, the mounting tag (optional)

Copy the appropriate html tag to your site to display traffic location. You can not arbitrarily change the labels garlic for their favorite display, the third part of the content of the reference extension development. According to you want to display different content, which is divided into several cases.

1, showing total site visits
to show the total traffic site, copy the following code to the position you want to display. There are two methods available:

Algorithm a: pv way, a single user clicks n successive articles, recorded n times traffic.


The total site visitsTime

algorithm b: uv way, a single user clicks n successive articles, the number of visitors recorded only once.


Number of visitors to this siteVisitors

If you are using hexo, open themes / topics /layout/_partial/footer.ejs you can add.

Reference Example Effect:

http://liam0205.me
http://gameknife.github.io
http://read.mobi
http://pgqlife.info
http://sdxy0506.github.io
http://www.gcrimson.com
HTTP: //libk.net
http://ztyoung.me
http://blog.itmyhome.com
2, shows a single page views
to be displayed visits for each article, copy the following code to the position you want to display.

Algorithm: pv way, a single user clicks on an article, read this article once a record amount.


The total amount of reading this articleTime

code text can be modified, as long as you can retain the correct id.

Reference Example Effect:

http://dbarobin.com/2015/04/14/operation-and-maintenance-engineer-tips
http://blog.jamespan.me/2015/05/06/mvn-incremental-compilation
HTTP: // cubernet. cn / blog / optimization-3
Note: in order to maintain the minimalist no garlic does not support the display one by one the number of times to read each article site article summary list (such as home), so if you need this feature, you can leave a message. To the extent required to consider the development of corresponding functions.

3, shows the total site visits and page views alone
you know it, the above two code labels are installed.

Reference Example Effect:

http://cubernet.cn/blog/swift-1
http://lvzejun.cn/2015/03/31/ubuntu-software
http://www.lvzejun.cn/2015/04/13/libvirt1md

My configuration

1, the configuration is not open garlic traffic statistics

在themes/icarus/_config.yml添加属性

Whether to open the traffic statistics function (without garlic)
busuanzi:
enable: to true

2, the introduction is not garlic and add the site visits

在themes/icarus/layout/footer.ejs末尾添加如下代码

<% if (theme.busuanzi && theme.busuanzi.enable){ %>
        <!-- 不蒜子统计 -->
        <span id="busuanzi_container_site_pv">
                本站总访问量<span id="busuanzi_value_site_pv"></span>次
        </span>
        <span class="post-meta-divider">|</span>
        <span id="busuanzi_container_site_uv" style='display:none'>
                本站访客数<span id="busuanzi_value_site_uv"></span>人
        </span>
        <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
  <% } %>

3, add articles traffic
in themes / icarus / layout / common / article.ejs add the following code at the beginning of
fact, I'm not sure if this code can be
Here Insert Picture Description
due to the configuration of the icarus theme is rather special, I did not quite some configuration items OK, so it is configured up
Here Insert Picture Description

Time line display on the site

Here Insert Picture Description

Show results

Look at the bottom of the display of results I blog it: how2playlife.com
Here Insert Picture Description

Guess you like

Origin www.cnblogs.com/xll1025/p/11520607.html