Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xianmin/hugo-theme-jane.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Xianmin <xianmin12@gmail.com>2018-08-15 11:15:28 +0300
committerChen Xianmin <xianmin12@gmail.com>2018-08-15 11:15:28 +0300
commit1af02095e0f72916e1f4f54737215e36a6140c20 (patch)
treedfd10292316e75773c4169abb4d2c6b7e44d03e9
parentd24534f71ea2d74f63d366223dbbb1d333552a37 (diff)
feat: add busuanzi counter. #95 #104
This is a visitor counter for chinese user. http://busuanzi.ibruce.info/
-rw-r--r--exampleSite/config.toml4
-rw-r--r--layouts/partials/footer.html17
-rw-r--r--layouts/partials/scripts.html5
-rw-r--r--layouts/post/single.html11
4 files changed, 31 insertions, 6 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 8621214..e6042af 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -126,12 +126,14 @@ defaultContentLanguage = "en" # Default language to use
clientId = "" # Your client ID
clientSecret = "" # Your client secret
-
[params.reward] # 文章打赏
enable = false
wechat = "/path/to/your/wechat-qr-code.png" # 微信二维码
alipay = "/path/to/your/alipay-qr-code.png" # 支付宝二维码
+ [params.counter.busuanzi] # a Chinese visitor counter # 不蒜子计数器
+ enable = false
+
[params.social] # 社交链接
a-email = "mailto:your@email.com"
b-stack-overflow = "http://localhost:1313"
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index c5c0312..42e9b6b 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -35,8 +35,19 @@
<span class="heart">
<i class="iconfont icon-heart"></i>
</span>
-{{- if or .Site.Copyright .Site.Author.name -}}
- <span class="author">{{if .Site.Copyright }}{{ .Site.Copyright | safeHTML }}{{ else }}{{ .Site.Author.name | safeHTML }}{{ end }}</span>
-{{- end -}}
+ {{- if or .Site.Copyright .Site.Author.name -}}
+ <span class="author">
+ {{if .Site.Copyright }}{{ .Site.Copyright | safeHTML }}
+ {{ else }}{{ .Site.Author.name | safeHTML }}
+ {{ end }}
+ </span>
+ {{- end -}}
</span>
+
+ <!-- Counter busuanzi -->
+ {{ if .Site.Params.counter.busuanzi.enable }}
+ <span id="busuanzi_container">
+ 访客数/访问量:<span id="busuanzi_value_site_uv"></span>/<span id="busuanzi_value_site_pv"></span>
+ </span>
+ {{ end }}
</div>
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index 0badc70..f005fca 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -81,6 +81,11 @@
{{ end }}
{{ end }}
+<!-- Counter busuanzi -->
+{{ if .Site.Params.counter.busuanzi.enable }}
+ <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
+{{ end }}
+
<!-- custom js -->
{{ range .Site.Params.customJS }}
<script src="{{ "/js/" | relURL }}{{ . }}"></script>
diff --git a/layouts/post/single.html b/layouts/post/single.html
index 21b9d0e..328b180 100644
--- a/layouts/post/single.html
+++ b/layouts/post/single.html
@@ -18,9 +18,16 @@
</div>
{{- end }}
{{ if .Site.Params.moreMeta -}}
- <span class="more-meta"> {{ i18n "wordCount" .WordCount }} </span>
- <span class="more-meta"> {{ i18n "readingTime" .ReadingTime }} </span>
+ <span class="more-meta"> {{ i18n "wordCount" .WordCount }} </span>
+ <span class="more-meta"> {{ i18n "readingTime" .ReadingTime }} </span>
{{- end }}
+
+ <!-- Counter busuanzi -->
+ {{ if .Site.Params.counter.busuanzi.enable }}
+ <span id="busuanzi_container_page_pv">
+ | 阅读 <span id="busuanzi_value_page_pv"></span>
+ </span>
+ {{ end }}
</div>
</header>