diff --git a/_config.yml b/_config.yml
index f5dd1319e..329357a04 100644
--- a/_config.yml
+++ b/_config.yml
@@ -47,7 +47,7 @@ fancybox: true ## If you want to use fancybox please set the value to true.
show_category_count: false ## If you want to show the count of categories in the sidebar widget please set the value to true.
toc_number: true ## If you want to add list number to toc please set the value to true.
shareto: false ## If you want to use the share button please set the value to true, and you must have hexo-helper-qrcode installed.
-busuanzi: false ## If you want to use Busuanzi page views please set the value to true.
+busuanzi: true ## If you want to use Busuanzi page views please set the value to true.
wordcount: false ## If you want to display the word counter and the reading time expected to spend of each post please set the value to true, and you must have hexo-wordcount installed.
widgets_on_small_screens: false ## Set to true to enable widgets on small screens.
canvas_nest:
@@ -115,6 +115,31 @@ timeline:
- num: 4
word: More
+badges:
+ - lable: Powered by
+ message: Hexo
+ color: blue
+ url: https://hexo.io
+ # title: Hexo
+ - lable: Theme
+ message: Maupassant
+ color: yellowgreen
+ url: https://www.haomwei.com/technology/maupassant-hexo.html
+ - lable: UV
+ type: uv
+ message:
+ color: orange
+ - lable: PV
+ type: pv
+ message:
+ color: lightgray
+# - logo: 'https://www.upyun.com/static/favicon-64x64.png' # or 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0i...wvZz4gPC9nPjwvc3ZnPg=='
+# lable: CDN # PV
+# message: εζδΊ
+# color: blue # values: brightgreen, green, yellowgreen, orange, yellow, blueviolet, pink, red, blue, grey/gray, lightgrey/lightgray
+# url: https://www.upyun.com/?utm_source=lianmeng&utm_medium=referral
+# title: # for url
+
# Static files
js: js
css: css
diff --git a/layout/_partial/footer.pug b/layout/_partial/footer.pug
index 1c7ed5f24..444072033 100644
--- a/layout/_partial/footer.pug
+++ b/layout/_partial/footer.pug
@@ -5,3 +5,19 @@
a(rel='nofollow', target='_blank', href='https://github.com/tufu9441/maupassant-hexo') Theme
| by
a(rel='nofollow', target='_blank', href='https://github.com/pagecho') Cho.
+ if theme.busuanzi
+ script(src='https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js', async)
+ div()
+ each v, i in theme.badges
+ - var type = ''
+ if v.type == 'pv' || v.type == 'uv'
+ - type = v.type
+ div(class="github-badge")
+ a(href=v.url, target='_black', rel='nofollow', title=v.title)
+ span(class='badge-subject') !{v.lable ? v.lable : ' '}
+ span(class='badge-value bg-'+ (v.color ? v.color : 'brightgreen'), id = type ? `busuanzi_value_site_${type}` : false)
+ if v.logo
+ != ``
+ |!{v.message || v.logo ? v.message : ' '}
+ |
+ |
diff --git a/layout/post.pug b/layout/post.pug
index 33e76a06f..f38909543 100644
--- a/layout/post.pug
+++ b/layout/post.pug
@@ -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://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js', async)
span#busuanzi_container_page_pv= ' | '
span#busuanzi_value_page_pv
span= ' ' + __('Hits')
diff --git a/source/css/style.scss b/source/css/style.scss
index f655a984a..d0401d29a 100644
--- a/source/css/style.scss
+++ b/source/css/style.scss
@@ -456,6 +456,72 @@ div {
}
}
+.github-badge {
+ display: inline-block;
+ border-radius: 4px;
+ text-shadow: none;
+ font-size: 12px;
+ color: #fff;
+ line-height: 1.25;
+ background-color: #ABBAC3;
+ margin-bottom: 5px;
+ a {
+ color: #fff;
+ }
+ img {
+ /*height: "calc(%s * 1.25)" % $fontsize-footnote*/
+ height: 1.25em;
+ vertical-align: top;
+ }
+ .badge-subject {
+ display: inline-block;
+ background-color: #555;
+ padding: 4px 4px 4px 6px;
+ border-top-left-radius: 4px;
+ border-bottom-left-radius: 4px;
+ }
+ .badge-value {
+ display: inline-block;
+ padding: 4px 6px 4px 4px;
+ border-top-right-radius: 4px;
+ border-bottom-right-radius: 4px;
+ }
+ .bg-brightgreen {
+ background-color: #4c1 !important;
+ }
+ .bg-green {
+ background-color: #97ca00 !important;
+ }
+ .bg-yellowgreen {
+ background-color: #a4a61d !important;
+ }
+ .bg-orange {
+ background-color: #FE7D37 !important;
+ }
+ .bg-yellow {
+ background-color: #dfb317 !important;
+ }
+ .bg-blueviolet {
+ background-color: #8A2BE2 !important;
+ }
+ .bg-pink {
+ background-color: #FFC0CB !important;
+ }
+ .bg-red {
+ background-color: #e05d44 !important;
+ }
+ .bg-blue {
+ background-color: #007EC6 !important;
+ }
+ .bg-grey,
+ .bg-gray {
+ background-color: #555 !important;
+ }
+ .bg-lightgrey,
+ .bg-lightgray {
+ background-color: #9f9f9f !important;
+ }
+}
/* for archive page starts*/