Show PV/UV of blog and PV of each article (#405)

Show PV/UV of blog and PV of each article
This commit is contained in:
Susreal Zhao 2019-02-02 00:04:39 +08:00 committed by Ruipeng Zhang
parent cad64ed5a2
commit 7c359ba5ae
4 changed files with 31 additions and 0 deletions

View File

@ -64,5 +64,10 @@ module.exports = {
[type]: 'boolean',
[doc]: 'Show the copy button in the highlighted code area',
[defaultValue]: true
},
visit: {
[type]: 'boolean',
[doc]: 'Show PV/UV of blog and PV of each article',
[defaultValue]: false
}
};

View File

@ -41,6 +41,17 @@
<div class="content">
<%- index && post.excerpt ? post.excerpt : post.content %>
</div>
<% if (!index && (has_config('plugins.visit') ? get_config('plugins.visit') : false)) { %>
<div class="level is-size-7 has-text-grey">
<div class="level-left">
<i class="far fa-eye"></i>
<span>&nbsp;</span>
<span id="busuanzi_container_page_pv" style="display: inline;">
<span id="busuanzi_value_page_pv">0</span>
</span>
</div>
</div>
<% } %>
<% if (!index && post.tags && post.tags.length) { %>
<div class="level is-size-7 is-uppercase">
<div class="level-start">

View File

@ -14,6 +14,16 @@
Powered by <a href="http://hexo.io/" target="_blank">Hexo</a> & <a
href="http://github.com/ppoffice/hexo-theme-icarus" target="_blank">Icarus</a>
</p>
<% if (has_config('plugins.visit') ? get_config('plugins.visit') : false) { %>
<p class="is-size-7">
<span id="busuanzi_container_site_uv">
UV:<span id="busuanzi_value_site_uv">0</span>,
</span>
<span id="busuanzi_container_site_pv">
PV:<span id="busuanzi_value_site_pv">0</span>
</span>
</p>
<% } %>
</div>
<div class="level-end">
<% if (has_config('footer.links')) { %>

5
layout/plugin/visit.ejs Normal file
View File

@ -0,0 +1,5 @@
<% if (plugin !== false) { %>
<% if (head) { %>
<script async="" src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<% } %>
<% } %>