Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add total site count about hits and visitor #175

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Maupassant


[![Build Status](https://travis-ci.org/tufu9441/maupassant-hexo.svg?branch=master)](https://travis-ci.org/tufu9441/maupassant-hexo) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/tufu9441/maupassant-hexo/blob/master/LICENSE)

> 大道至简
Expand Down Expand Up @@ -39,6 +40,7 @@ baidu_analytics: ## Your Baidu Analytics tracking id, e.g. 8006843039519956000
show_category_count: false ## If you want to show the count of categories in the sidebar widget please set the value to true.
shareto: true ## If you want to use the share button please set the value to true.
busuanzi: true ## If you want to use Busuanzi page views please set the value to true.
total_visit_busuanzi: true ## First,you must set busuanzi true, then you can show total count about site views and user views
widgets_on_small_screens: false ## Set to true to enable widgets on small screens.

menu:
Expand Down Expand Up @@ -101,6 +103,7 @@ version: 0.0.0
- show_category_count - Show the count of categories in the sidebar widget.
- shareto - Enable share button
- busuanzi - Enable [Busuanzi](http://busuanzi.ibruce.info) page views
- total_visit_busuanzi - Enable [Busuanzi](http://busuanzi.ibruce.info) site views and visitors, make sure `busuanzi` set true.
- widgets_on_small_screens - Show the widgets at the bottom of small screens.
- menu - Customize your menu of pages here, just follow the format of existied items. Don't forget to create corresponding folders inlcuding `index.md` in `source` folder to ensure the pages will correctly display. [FontAwesome](http://fontawesome.io) icon fonts have been integrated, and you can choose other icons which you like [here](http://fontawesome.io/icons/) and use them according to the instruction.
- widgets - Choose and arrange the widgets in sidebar here.
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ baidu_analytics: ## Your Baidu Analytics tracking id, e.g. 8006843039519956000
show_category_count: false ## If you want to show the count of categories in the sidebar widget please set the value to true.
shareto: true ## If you want to use the share button please set the value to true.
busuanzi: true ## If you want to use Busuanzi page views please set the value to true.
total_visit_busuanzi: true ## First,you must set busuanzi true, then you can show total count about site views and user views
widgets_on_small_screens: false ## Set to true to enable widgets on small screens.

menu:
Expand Down
3 changes: 3 additions & 0 deletions layout/_partial/after_footer.jade
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ if page.mathjax2

script(type='text/javascript', src=url_for(theme.js) + '/codeblock-resizer.js' + '?v=' + theme.version)
script(type='text/javascript', src=url_for(theme.js) + '/smartresize.js' + '?v=' + theme.version)

if theme.busuanzi == true
script(src='https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js', async)
14 changes: 13 additions & 1 deletion layout/_partial/footer.jade
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
#footer= '© '
#footer
if theme.busuanzi == true
if theme.total_visit_busuanzi == true
div
| Total
span#busuanzi_container_site_pv
span= ' '
span#busuanzi_value_site_pv
span(rel='nofollow')= ' ' + __(' hits, ')
span#busuanzi_container_site_uv
span#busuanzi_value_site_uv
span(rel='nofollow')= ' ' + __(' visitors.')
= '© '
a(href=url_for('.'), rel='nofollow')= config.title + '.'
| Powered by
a(rel='nofollow', target='_blank', href='https://hexo.io') Hexo.
Expand Down
1 change: 0 additions & 1 deletion layout/post.jade
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ block content
for category in page.categories.toArray()
a(href=url_for(category.path))= category.name
if theme.busuanzi == true
script(src='https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js', async)
span#busuanzi_container_page_pv= ' | '
span#busuanzi_value_page_pv
span= ' ' + __('Hits')
Expand Down