♻️ Refactor: deprecate params.ibruce in favor of params.busuanzi powered by Vercount

Resolve #472
Close EvanNotFound/vercount#10
This commit is contained in:
Cell
2024-07-28 13:34:53 +08:00
parent 6c752c1bbd
commit 7c67b90acf
7 changed files with 54 additions and 35 deletions
+1
View File
@@ -188,6 +188,7 @@ Thanks to all the [contributors](https://github.com/hugo-fixit/FixIt/graphs/cont
- [cookieconsent](https://github.com/osano/cookieconsent) - [cookieconsent](https://github.com/osano/cookieconsent)
- [cell-watermark](https://github.com/Lruihao/watermark) - [cell-watermark](https://github.com/Lruihao/watermark)
- [不蒜子](http://busuanzi.ibruce.info/) - [不蒜子](http://busuanzi.ibruce.info/)
- [Vercount](https://github.com/EvanNotFound/vercount)
- [pangu.js](https://github.com/vinta/pangu.js) - [pangu.js](https://github.com/vinta/pangu.js)
- [Artalk](https://artalk.js.org/) - [Artalk](https://artalk.js.org/)
- [Waline](https://waline.js.org/) - [Waline](https://waline.js.org/)
+1
View File
@@ -192,6 +192,7 @@ FixIt 支持下列语言:
- [cookieconsent](https://github.com/osano/cookieconsent) - [cookieconsent](https://github.com/osano/cookieconsent)
- [cell-watermark](https://github.com/Lruihao/watermark) - [cell-watermark](https://github.com/Lruihao/watermark)
- [不蒜子](http://busuanzi.ibruce.info/) - [不蒜子](http://busuanzi.ibruce.info/)
- [Vercount](https://github.com/EvanNotFound/vercount)
- [pangu.js](https://github.com/vinta/pangu.js) - [pangu.js](https://github.com/vinta/pangu.js)
- [Artalk](https://artalk.js.org/) - [Artalk](https://artalk.js.org/)
- [Waline](https://waline.js.org/) - [Waline](https://waline.js.org/)
+9 -4
View File
@@ -693,11 +693,16 @@ enableEmoji = true
# FixIt 0.2.13 | NEW watermark's fontFamily # FixIt 0.2.13 | NEW watermark's fontFamily
fontFamily = "inherit" fontFamily = "inherit"
# FixIt 0.2.12 | NEW Busuanzi count # FixIt 0.3.10 | NEW Busuanzi count
[params.ibruce] [params.busuanzi]
# whether to enable busuanzi count
enable = false enable = false
# Enable in post meta # busuanzi count core ["vercount", "busuanzi"], default: "vercount"
enablePost = false core = "vercount"
# whether to show the site views
siteViews = true
# whether to show the page views
pageViews = true
# Site verification code config for Google/Bing/Yandex/Pinterest/Baidu/360/Sogou # Site verification code config for Google/Bing/Yandex/Pinterest/Baidu/360/Sogou
[params.verification] [params.verification]
+9 -3
View File
@@ -210,9 +210,15 @@
{{- end -}} {{- end -}}
{{- /* 不蒜子 */ -}} {{- /* 不蒜子 */ -}}
{{- if eq .Site.Params.ibruce.enable true -}} {{- if eq .Site.Params.busuanzi.enable true -}}
{{- $source := "//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" -}} {{- $source := "https://vercount.one/js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Async" true "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} {{- if eq .Lang "zh-cn" -}}
{{- $source = "https://cn.vercount.one/js" -}}
{{- end -}}
{{- if eq .Site.Params.busuanzi.core "busuanzi" -}}
{{- $source = "//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" -}}
{{- end -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}} {{- end -}}
{{- /* Site creation time */ -}} {{- /* Site creation time */ -}}
+9 -4
View File
@@ -70,15 +70,20 @@
{{- end -}} {{- end -}}
{{- /* 不蒜子 */ -}} {{- /* 不蒜子 */ -}}
{{- if eq .Site.Params.ibruce.enable true -}} {{- $busuanzi := .Site.Params.busuanzi -}}
{{- if eq $busuanzi.enable true -}}
{{- $loading := dict "Class" "fa-solid fa-spinner fa-spin fa-fw" | partial "plugin/icon.html" -}} {{- $loading := dict "Class" "fa-solid fa-spinner fa-spin fa-fw" | partial "plugin/icon.html" -}}
<div class="footer-line visitor{{ with $footerConfig.order.visitor }} order-{{ . }}{{ end }}"> {{- $iconUV := dict "Class" "fa-regular fa-user fa-fw me-1" | partial "plugin/icon.html" -}}
{{- $iconPV := dict "Class" "fa-regular fa-eye fa-fw me-1" | partial "plugin/icon.html" -}}
<div class="footer-line visitor{{ with $footerConfig.order.visitor }} order-{{ . }}{{ end }}{{ if not $busuanzi.siteViews }} d-none{{ end }}">
<span id="busuanzi_container_site_uv" title='{{ T "footer.siteUV" }}'> <span id="busuanzi_container_site_uv" title='{{ T "footer.siteUV" }}'>
{{- dict "Class" "fa-regular fa-user fa-fw" | partial "plugin/icon.html" -}}&nbsp;<span id="busuanzi_value_site_uv">{{ $loading }}</span>{{- /* NO_SPACING */ -}} {{- $iconUV }}<span id="busuanzi_value_site_uv">{{ $loading }}</span>
{{- /* NO_SPACING */ -}}
</span> </span>
{{- /* NO_SPACING */ -}} {{- /* NO_SPACING */ -}}
<span id="busuanzi_container_site_pv" class="footer-divider" title='{{ T "footer.sitePV" }}'> <span id="busuanzi_container_site_pv" class="footer-divider" title='{{ T "footer.sitePV" }}'>
{{- dict "Class" "fa-regular fa-eye fa-fw" | partial "plugin/icon.html" -}}&nbsp;<span id="busuanzi_value_site_pv">{{ $loading }}</span>{{- /* NO_SPACING */ -}} {{- $iconPV }}<span id="busuanzi_value_site_pv">{{ $loading }}</span>
{{- /* NO_SPACING */ -}}
</span> </span>
</div> </div>
{{- end -}} {{- end -}}
@@ -14,6 +14,10 @@
{{- $warns = $warns | append "The parameter `params.footer.custom` is deprecated since v0.3.7, use `layouts/partials/custom.html` instead." -}} {{- $warns = $warns | append "The parameter `params.footer.custom` is deprecated since v0.3.7, use `layouts/partials/custom.html` instead." -}}
{{- end -}} {{- end -}}
{{- with .Site.Params.ibruce -}}
{{- $warns = $warns | append "The parameter `params.ibruce` is deprecated since v0.3.9, use `params.busuanzi` instead." -}}
{{- end -}}
{{- if len $warns -}} {{- if len $warns -}}
{{- warnf "Deprecated parameter detection until %v\n - %v\n\n" (.Scratch.Get "version") (delimit $warns "\n - ") -}} {{- warnf "Deprecated parameter detection until %v\n - %v\n\n" (.Scratch.Get "version") (delimit $warns "\n - ") -}}
{{- end -}} {{- end -}}
+21 -24
View File
@@ -87,31 +87,25 @@
{{- $visitorIcon := dict "Class" "fa-regular fa-eye fa-fw me-1" | partial "plugin/icon.html" -}} {{- $visitorIcon := dict "Class" "fa-regular fa-eye fa-fw me-1" | partial "plugin/icon.html" -}}
{{- $commentIcon := dict "Class" "fa-regular fa-comments fa-fw me-1" | partial "plugin/icon.html" -}} {{- $commentIcon := dict "Class" "fa-regular fa-comments fa-fw me-1" | partial "plugin/icon.html" -}}
{{- /* Visitor Count */ -}} {{- /* Visitor Count */ -}}
{{- if $comment.enable -}} {{- if $comment.enable | and $comment.artalk.enable -}}
{{- if $comment.artalk.enable -}} <span class="comment-visitors" data-flag-title="{{ $title }}">
<span class="comment-visitors" data-flag-title="{{ $title }}"> {{- $visitorIcon }}<span class="artalk-visitor-count" data-page-key="{{ .RelPermalink }}">-</span>&nbsp;{{ T "single.views" }}
{{ $visitorIcon }}<span class="artalk-visitor-count" data-page-key="{{ .RelPermalink }}">-</span>&nbsp;{{ T "single.views" }} </span>&nbsp;
</span>&nbsp; {{- else if $comment.enable | and $comment.valine.enable | and $comment.valine.visitor -}}
{{- else if ($comment.valine.enable | and $comment.valine.visitor) -}} <span id="{{ .RelPermalink }}" class="leancloud_visitors comment-visitors" data-flag-title="{{ $title }}">
<span id="{{ .RelPermalink }}" class="leancloud_visitors comment-visitors" data-flag-title="{{ $title }}"> {{- $visitorIcon }}<span class="leancloud-visitors-count">-</span>&nbsp;{{ T "single.views" }}
{{ $visitorIcon }}<span class="leancloud-visitors-count">-</span>&nbsp;{{ T "single.views" }} </span>&nbsp;
</span>&nbsp; {{- else if $comment.enable | and $comment.waline.enable | and $comment.waline.pageview -}}
{{- else if $comment.waline.enable | and $comment.waline.pageview -}} <span class="comment-visitors" data-flag-title="{{ $title }}">
<span class="comment-visitors" data-flag-title="{{ $title }}"> {{- $visitorIcon }}<span data-path="{{ .RelPermalink }}" class="waline-pageview-count">-</span>&nbsp;{{ T "single.views" }}
{{ $visitorIcon }}<span data-path="{{ .RelPermalink }}" class="waline-pageview-count">-</span>&nbsp;{{ T "single.views" }} </span>&nbsp;
</span>&nbsp; {{- else if $comment.enable | and $comment.twikoo.enable | and $comment.twikoo.visitor -}}
{{- else if $comment.twikoo.enable | and $comment.twikoo.visitor -}} <span id="{{ .RelPermalink }}" class="comment-visitors" data-flag-title="{{ $title }}">
<span id="{{ .RelPermalink }}" class="comment-visitors" data-flag-title="{{ $title }}"> {{- $visitorIcon }}<span id="twikoo_visitors">-</span>&nbsp;{{ T "single.views" }}
{{ $visitorIcon }}<span id="twikoo_visitors">-</span>&nbsp;{{ T "single.views" }} </span>&nbsp;
</span>&nbsp; {{- else if .Site.Params.busuanzi.enable | and .Site.Params.busuanzi.pageViews -}}
{{- else if .Site.Params.ibruce.enable | and .Site.Params.ibruce.enablePost -}}
<span id="busuanzi_container_page_pv" class="busuanzi_visitors comment-visitors" data-flag-title="{{ $title }}">
{{ $visitorIcon }}<span id="busuanzi_value_page_pv">-</span>&nbsp;{{ T "single.views" }}
</span>&nbsp;
{{- end -}}
{{- else if .Site.Params.ibruce.enable | and .Site.Params.ibruce.enablePost -}}
<span id="busuanzi_container_page_pv" class="busuanzi_visitors comment-visitors" data-flag-title="{{ $title }}"> <span id="busuanzi_container_page_pv" class="busuanzi_visitors comment-visitors" data-flag-title="{{ $title }}">
{{ $visitorIcon }}<span id="busuanzi_value_page_pv">-</span>&nbsp;{{ T "single.views" }} {{- $visitorIcon }}<span id="busuanzi_value_page_pv">-</span>&nbsp;{{ T "single.views" }}
</span>&nbsp; </span>&nbsp;
{{- end -}} {{- end -}}
{{- /* Comment Count */ -}} {{- /* Comment Count */ -}}
@@ -208,6 +202,9 @@
{{- partial "single/reward.html" . -}} {{- partial "single/reward.html" . -}}
{{- end -}} {{- end -}}
{{- /* Custom post footer */ -}}
{{- block "custom-post__footer" . }}{{ end -}}
{{- /* Comment */ -}} {{- /* Comment */ -}}
{{- partial "single/comment.html" . -}} {{- partial "single/comment.html" . -}}
</article> </article>