mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
✨ Feat: add Baidu, Umami, Plausible, Cloudflare and Splitbee analytics support
resolved #549
This commit is contained in:
@@ -65,6 +65,11 @@ I don't know why 🤷
|
||||
- Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD
|
||||
- **[Google Analytics](https://analytics.google.com/analytics)** supported
|
||||
- **[Fathom Analytics](https://usefathom.com/)** supported
|
||||
- **[Baidu Analytics](https://tongji.baidu.com/)** supported
|
||||
- **[Umami Analytics](https://umami.is/)** supported
|
||||
- **[Plausible Analytics](https://plausible.io/)** supported
|
||||
- **[Cloudflare Web Analytics](https://www.cloudflare.com/web-analytics)** supported
|
||||
- **[Splitbee Analytics](https://splitbee.io)** supported
|
||||
- Search engine **verification** supported (Google, Bing, Yandex, Pinterest, Baidu, 360 and Sogou)
|
||||
- **CDN** for third-party libraries supported
|
||||
|
||||
|
||||
@@ -65,6 +65,11 @@
|
||||
- 使用基于 JSON-LD 格式 的 **SEO SCHEMA** 文件进行 SEO 优化
|
||||
- 支持 **[Google Analytics](https://analytics.google.com/analytics)**
|
||||
- 支持 **[Fathom Analytics](https://usefathom.com/)**
|
||||
- 支持 **[百度统计](https://tongji.baidu.com/)**
|
||||
- 支持 **[Umami Analytics](https://umami.is/)**
|
||||
- 支持 **[Plausible Analytics](https://plausible.io/)**
|
||||
- 支持 **[Cloudflare Web Analytics](https://www.cloudflare.com/web-analytics)**
|
||||
- 支持 **[Splitbee Analytics](https://splitbee.io)**
|
||||
- 支持搜索引擎的**网站验证** (Google, Bing, Yandex, Pinterest, Baidu, 360 and Sogou)
|
||||
- 支持所有第三方库的 **CDN**
|
||||
|
||||
|
||||
@@ -777,6 +777,31 @@ enableEmoji = true
|
||||
id = ""
|
||||
# server url for your tracker if you're self hosting
|
||||
server = ""
|
||||
# FixIt 0.3.16 | NEW Baidu Analytics
|
||||
[params.analytics.baidu]
|
||||
id = ""
|
||||
# FixIt 0.3.16 | NEW Umami Analytics
|
||||
[params.analytics.umami]
|
||||
data_website_id = ""
|
||||
src = ""
|
||||
data_host_url = ""
|
||||
data_domains = ""
|
||||
# FixIt 0.3.16 | NEW Plausible Analytics
|
||||
[params.analytics.plausible]
|
||||
data_domain = ""
|
||||
src = ""
|
||||
# FixIt 0.3.16 | NEW Cloudflare Analytics
|
||||
[params.analytics.cloudflare]
|
||||
token = ""
|
||||
# FixIt 0.3.16 | NEW Splitbee Analytics
|
||||
[params.analytics.splitbee]
|
||||
enable = false
|
||||
# no cookie mode
|
||||
no_cookie = true
|
||||
# respect the do not track setting of the browser
|
||||
do_not_track = true
|
||||
# token(optional), more info on https://splitbee.io/docs/embed-the-script
|
||||
data_token = ""
|
||||
|
||||
# Cookie consent config
|
||||
[params.cookieconsent]
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
configurationError = "Configuration Error\nYou haven't configured the FixIt version param correctly yet. See https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
|
||||
compatibilityError = "Compatibility Error ({{ .From }} -> {{ .To }}):\nYou have an incompatible update. See https://github.com/hugo-fixit/FixIt/releases"
|
||||
devVersionWarn = "You are using a development version of FixIt. Please consider using a stable version.\nSee https://github.com/hugo-fixit/FixIt/releases"
|
||||
devEnvWarn = "Current environment is \"development\". The \"comment system\", \"PWA\", \"CDN\" and \"fingerprint\" will be disabled."
|
||||
devEnvWarn = "Current environment is \"development\". The \"comment system\", \"PWA\", \"CDN\", \"fingerprint\" and \"analytics\" will be disabled."
|
||||
quicklyUpgrade = "Quickly upgrade use command: "
|
||||
# === init ===
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
configurationError = "Erreur de configuration\nVous n'avez pas configuré la version de FixIt correctement. Voir https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
|
||||
compatibilityError = "Erreur de compatibilité ({{ .From }} -> {{ .To }}):\nVous avez une mise à jour incompatible. Voir https://github.com/hugo-fixit/FixIt/releases"
|
||||
devVersionWarn = "Vous utilisez une version de développement de FixIt. Veuillez considérer l'utilisation d'une version stable.\nVoir https://github.com/hugo-fixit/FixIt/releases"
|
||||
devEnvWarn = "L'environnement actuel est \"développement\". Le \"système de commentaires\", le \"PWA\", le \"CDN\" et la \"prise d'empreinte\" seront désactivés."
|
||||
devEnvWarn = "L'environnement actuel est \"développement\". Le \"système de commentaires\", le \"PWA\", le \"CDN\", le \"prise d'empreinte\" et la \"analyses\" seront désactivés."
|
||||
quicklyUpgrade = "La mise à jour rapide utilise la commande: "
|
||||
# === init ===
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
configurationError = "कन्फ़िग्यरेशन त्रुटि \nआपने फिक्सइट संस्करण पैरामीटर को सही ढंग से कॉन्फ़िगर नहीं किया है।. यह देखें: https://fixit.lruihao.cn/documentation/basics/#theme-configuration"
|
||||
compatibilityError = "संगतता त्रुटि ({{ .From }} -> {{ .To }}):\nआपके पास एक असंगत अपडेट है. यह देखें: https://github.com/hugo-fixit/FixIt/releases"
|
||||
devVersionWarn = "आप फिक्सइट के डिवेलपर संस्करण का उपयोग कर रहे हैं। कृपया एक स्थिर संस्करण का उपयोग करने पर विचार करें।\nयह देखें: https://github.com/hugo-fixit/FixIt/releases"
|
||||
devEnvWarn = "वर्तमान परिवेश \"डिवेलप्मेंट\" का है। \"टिप्पणी प्रणाली\", \"पीडब्ल्यूए\", \"सीडीएन\" और \"फ़िंगरप्रिंट\" अक्षम कर दिए जाएंगे। "
|
||||
devEnvWarn = "वर्तमान परिवेश \"डिवेलप्मेंट\" का है। \"टिप्पणी प्रणाली\", \"पीडब्ल्यूए\", \"सीडीएन\", \"फ़िंगरप्रिंट\" और \"विश्लेषण\" अक्षम कर दिए जाएंगे।"
|
||||
quicklyUpgrade = "शीघ्रता से अपग्रेड यह कमांड का उपयोग करें: "
|
||||
# === init ===
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
configurationError = "配置文件错误\n您还没有正确配置 FixIt 的版本参数。参考 https://fixit.lruihao.cn/zh-cn/documentation/basics/#theme-configuration"
|
||||
compatibilityError = "兼容性错误 ({{ .From }} -> {{ .To }}):\n您进行了一次不兼容的更新。参考 https://github.com/hugo-fixit/FixIt/releases"
|
||||
devVersionWarn = "您正在使用开发版的 FixIt,请考虑使用稳定版。\n见 https://github.com/hugo-fixit/FixIt/releases"
|
||||
devEnvWarn = "当前运行环境是“development”。“评论系统”、“PWA”、“CDN”和“fingerprint”不会启用。"
|
||||
devEnvWarn = "当前运行环境是“development”。“评论系统”、“PWA”、“CDN”、“fingerprint”和“统计”不会启用。"
|
||||
quicklyUpgrade = "使用命令快速升级:"
|
||||
# === init ===
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
configurationError = "配置文件錯誤\n您還沒有正確配置 FixIt 的版本參數。參考 https://fixit.lruihao.cn/zh-cn/documentation/basics/#theme-configuration"
|
||||
compatibilityError = "兼容性錯誤 ({{ .From }} -> {{ .To }}):\n您進行了一次不兼容的更新。参考 https://github.com/hugo-fixit/FixIt/releases"
|
||||
devVersionWarn = "您正在使用開發版的 FixIt,請考慮使用穩定版。\n見 https://github.com/hugo-fixit/FixIt/releases"
|
||||
devEnvWarn = "當前運行環境是“development”。“評論系統”、“PWA”、“CDN”和“fingerprint”不會啟用。"
|
||||
devEnvWarn = "當前運行環境是“development”。“評論系統”、“PWA”、“CDN”、“fingerprint”和“統計”不會啟用。"
|
||||
quicklyUpgrade = "使用命令快速升級:"
|
||||
# === init ===
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- .Scratch.Set "version" "v0.3.16-0ed41783" -}}
|
||||
{{- .Scratch.Set "version" "v0.3.16-f1ba78ef" -}}
|
||||
{{- .Scratch.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
@@ -19,4 +19,47 @@
|
||||
</script>
|
||||
{{- dict "Source" ($analytics.fathom.server | default "cdn.usefathom.com" | printf "https://%v/tracker.js") "Async" true "Attr" "id=fathom-script" | partial "plugin/script.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Baidu Analytics */ -}}
|
||||
{{- with $analytics.baidu.id -}}
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?{{ . }}";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Umami Analytics */ -}}
|
||||
{{- with $analytics.umami.data_website_id -}}
|
||||
<script async defer data-website-id="{{ . }}" src="{{ $analytics.umami.src }}" {{ with $analytics.umami.data_host_url }} data-host-url="{{ . }}" {{ end }} {{ with $analytics.umami.data_domains }} data-domains="{{ . }}" {{ end }}></script>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Plausible Analytics */ -}}
|
||||
{{- with $analytics.plausible.data_domain -}}
|
||||
<script async defer data-domain="{{ . }}" src="{{ $analytics.plausible.src }}"></script>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Cloudflare Analytics */ -}}
|
||||
{{- with $analytics.cloudflare.token -}}
|
||||
<script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "{{ $analytics.cloudflare.token }}"}'></script>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Splitbee Analytics */ -}}
|
||||
{{- if $analytics.splitbee.enable -}}
|
||||
{{- $attr := "" -}}
|
||||
{{- if $analytics.splitbee.do_not_track -}}
|
||||
{{- $attr = printf `%v data-respect-dnt` $attr -}}
|
||||
{{- end -}}
|
||||
{{- if $analytics.splitbee.no_cookie -}}
|
||||
{{- $attr = printf `%v data-no-cookie` $attr -}}
|
||||
{{- end -}}
|
||||
{{- with $analytics.splitbee.data_token -}}
|
||||
{{- $attr = printf `%v data-token="%v"` $attr . -}}
|
||||
{{- end -}}
|
||||
<script defer {{ with $attr }} {{ . | safeHTMLAttr }} {{ end }} src="https://cdn.splitbee.io/sb.js"></script>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user