From bde541edeb2a9dcca60ddff26d2f7ef22f92814d Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Tue, 30 Jul 2024 15:15:59 +0800 Subject: [PATCH] :zap: Perf(ignore): remove busuanzi.core and add busuanzi.source (#472) --- hugo.toml | 4 ++-- layouts/partials/assets.html | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/hugo.toml b/hugo.toml index 84ba87fce..53d142781 100644 --- a/hugo.toml +++ b/hugo.toml @@ -697,8 +697,8 @@ enableEmoji = true [params.busuanzi] # whether to enable busuanzi count enable = false - # busuanzi count core ["vercount", "busuanzi"], default: "vercount" - core = "vercount" + # busuanzi count core script source. Default is https://vercount.one/js + source = "https://vercount.one/js" # whether to show the site views siteViews = true # whether to show the page views diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index 14d7f9453..d762d23fa 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -211,13 +211,7 @@ {{- /* 不蒜子 */ -}} {{- if .Site.Params.busuanzi.enable | and hugo.IsProduction -}} - {{- $source := "https://vercount.one/js" -}} - {{- 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 -}} + {{- $source := .Site.Params.busuanzi.source | default "https://vercount.one/js" -}} {{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} {{- end -}}