diff --git a/_config.yml b/_config.yml index 79e2961cd..cee90c283 100755 --- a/_config.yml +++ b/_config.yml @@ -288,6 +288,23 @@ leancloud_visitors: app_id: # app_key: # +# Show PV/UV of the website/page with busuanzi. +# Get more information on http://ibruce.info/2015/04/04/busuanzi/ +busuanzi_count: + # count values only if the other configs are false + enable: false + # custom uv span for the whole site + site_uv: true + site_uv_header: + site_uv_footer: + # custom pv span for the whole site + site_pv: true + site_pv_header: + site_pv_footer: + # custom pv span for one page only + page_pv: true + page_pv_header: + page_pv_footer: # Tencent analytics ID # tencent_analytics: diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index c09bd9a9d..5cb880995 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -115,6 +115,12 @@ {% endif %} + {% if not is_index and theme.busuanzi_count.enable and theme.busuanzi_count.page_pv %} +   |   + {{ theme.busuanzi_count.page_pv_header }} + {{ theme.busuanzi_count.page_pv_footer }} + + {% endif %} {% endif %} diff --git a/layout/_partials/footer.swig b/layout/_partials/footer.swig index 69c27853f..4a4b1f956 100644 --- a/layout/_partials/footer.swig +++ b/layout/_partials/footer.swig @@ -19,4 +19,16 @@ +{% if theme.busuanzi_count.enable %} +
+ + {% if theme.busuanzi_count.site_uv %} + {{ theme.busuanzi_count.site_uv_header }}{{ theme.busuanzi_count.site_uv_footer }} + {% endif %} + {% if theme.busuanzi_count.site_pv %} + {{ theme.busuanzi_count.site_pv_header }}{{ theme.busuanzi_count.site_pv_footer }} + {% endif %} +
+{% endif %} + {% block footer %}{% endblock %} diff --git a/source/css/_common/components/footer/footer.styl b/source/css/_common/components/footer/footer.styl index 550704b33..97067b018 100644 --- a/source/css/_common/components/footer/footer.styl +++ b/source/css/_common/components/footer/footer.styl @@ -24,6 +24,36 @@ } } +.busuanzi-count { + &:before { + content: " "; + float: left; + width: 260px; + min-height: 25px; + } +} + +.site-uv, +.site-pv, +.page-pv { + display: inline-block; + + .busuanzi-value { + margin: 0 5px; + } +} + +if hexo-config("busuanzi_count.site_pv") and hexo-config("busuanzi_count.site_uv") + .site-uv + { + margin-right: 10px; + + &::after { + content: "|"; + padding-left: 10px; + } + } + .cc-license { margin-top: 10px; text-align: center;