From ff7b3dccd5761aa0461163809305d12f5ab181e8 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Sun, 28 Sep 2025 11:34:33 +0800 Subject: remove: umami web analytics integration Stopped tracking visitors because I realized that: 1. It's no necessary for personal blogs to analyze user behaviors, 2. Checking pageviews on a daily basis really messed up my mental health. Former-commit-id: 99deb4bd1c115b5b11f3632ca57ccc4d41fb3ee9 --- assets/js/settings.js | 6 ------ layouts/_partials/head.html | 1 - layouts/_partials/head/umami.html | 11 ----------- layouts/_partials/header/language-switch.html | 1 - layouts/_partials/header/navigation.html | 1 - layouts/_partials/home/home-nav-item.html | 3 +-- layouts/_partials/home/home-nav.html | 3 +-- layouts/_partials/home/latest-posts.html | 3 +-- layouts/_partials/items/post-small.html | 2 +- layouts/_partials/items/post.html | 5 +---- layouts/_partials/posts/action-menu/info-links.html | 4 ++-- layouts/_partials/posts/now-read-this.html | 2 +- layouts/_partials/scripts/action-menu-js.html | 4 ---- layouts/_partials/scripts/aplayer-js.html | 3 --- static/_headers | 1 - static/graph.html | 2 -- 16 files changed, 8 insertions(+), 44 deletions(-) delete mode 100644 layouts/_partials/head/umami.html diff --git a/assets/js/settings.js b/assets/js/settings.js index ecc027d2..6dcbdfa9 100644 --- a/assets/js/settings.js +++ b/assets/js/settings.js @@ -32,12 +32,6 @@ // initialize checkbox options function initCheckboxes() { const checkboxOptions = [ - { - id: 'dontAllowTracking', - label: '禁止网站使用 Web 分析工具跟踪用户行为', - storage: 'umami.disabled', - default: 'false' - }, { id: 'hideBatrick', label: '隐藏 Batrick(返回顶部按钮)', diff --git a/layouts/_partials/head.html b/layouts/_partials/head.html index 10cd1c0d..f2e4b8f3 100644 --- a/layouts/_partials/head.html +++ b/layouts/_partials/head.html @@ -4,5 +4,4 @@ {{ hugo.Generator }} {{ partial "head/siteinfo" . }} {{ partial "head/css" . }} - {{ partial "head/umami" . }} diff --git a/layouts/_partials/head/umami.html b/layouts/_partials/head/umami.html deleted file mode 100644 index 881b34c6..00000000 --- a/layouts/_partials/head/umami.html +++ /dev/null @@ -1,11 +0,0 @@ - - diff --git a/layouts/_partials/header/language-switch.html b/layouts/_partials/header/language-switch.html index 51a9c7b7..9f0a9c20 100644 --- a/layouts/_partials/header/language-switch.html +++ b/layouts/_partials/header/language-switch.html @@ -7,7 +7,6 @@ {{- $entry := index $switch $lang -}} {{ .name }} {{ end }} diff --git a/layouts/_partials/home/home-nav-item.html b/layouts/_partials/home/home-nav-item.html index cffe62ba..639e9762 100644 --- a/layouts/_partials/home/home-nav-item.html +++ b/layouts/_partials/home/home-nav-item.html @@ -3,8 +3,7 @@ {{ $text := .text }}
- + {{ if eq "/stats/" $.Page.RelPermalink }} opacity-100 font-bolder{{ end }}"> Cthulu-style monster with an eye.
  • diff --git a/layouts/_partials/home/latest-posts.html b/layouts/_partials/home/latest-posts.html index b6007c5c..cf80ece6 100644 --- a/layouts/_partials/home/latest-posts.html +++ b/layouts/_partials/home/latest-posts.html @@ -10,8 +10,7 @@ {{ $firstPost = false }} {{ end }}
  • - + {{ T "moreLinks.posts" }} → diff --git a/layouts/_partials/items/post-small.html b/layouts/_partials/items/post-small.html index 3113ba2b..28a4a995 100644 --- a/layouts/_partials/items/post-small.html +++ b/layouts/_partials/items/post-small.html @@ -1,7 +1,7 @@ {{ $isWeekly := (eq .Params.categories "稻草人周刊") }}
  • - + {{ .Title }}{{ with .Params.subtitle }}:{{. }} {{ end }} diff --git a/layouts/_partials/items/post.html b/layouts/_partials/items/post.html index 8aefb8a7..64606f04 100644 --- a/layouts/_partials/items/post.html +++ b/layouts/_partials/items/post.html @@ -10,10 +10,7 @@

    - + {{ if eq .ctx.Section "library" }} 读《{{ .ctx.Title }}》 {{ else }} diff --git a/layouts/_partials/posts/action-menu/info-links.html b/layouts/_partials/posts/action-menu/info-links.html index f1547d81..4adcf516 100644 --- a/layouts/_partials/posts/action-menu/info-links.html +++ b/layouts/_partials/posts/action-menu/info-links.html @@ -2,14 +2,14 @@
    + title="{{ T "actionMenu.telegramChannel" }}"> {{ T + title="{{ T "actionMenu.sponsor" }}"> {{ T diff --git a/layouts/_partials/posts/now-read-this.html b/layouts/_partials/posts/now-read-this.html index dae3aca0..ab2d79b8 100644 --- a/layouts/_partials/posts/now-read-this.html +++ b/layouts/_partials/posts/now-read-this.html @@ -3,7 +3,7 @@

    {{ T "nowReadThis" }}

    {{ range . }}
    - + {{ .LinkTitle }} {{ with .Params.subtitle }} :{{ . }} diff --git a/layouts/_partials/scripts/action-menu-js.html b/layouts/_partials/scripts/action-menu-js.html index e91b71f4..df1c498c 100644 --- a/layouts/_partials/scripts/action-menu-js.html +++ b/layouts/_partials/scripts/action-menu-js.html @@ -128,10 +128,6 @@ function initializeLikes(pageId) { window.sendLike = async function(pageId) { if (localStorage.getItem("liked_" + pageId)) return; - if (window.location.hostname !== 'localhost' && typeof umami !== 'undefined') { - umami.track('👍 Hit Like Button'); - } - try { const response = await fetch("https://like.guhub.cn/like/" + pageId, { method: "POST" }); const data = await response.json(); diff --git a/layouts/_partials/scripts/aplayer-js.html b/layouts/_partials/scripts/aplayer-js.html index 4d51ab63..e777b0c9 100644 --- a/layouts/_partials/scripts/aplayer-js.html +++ b/layouts/_partials/scripts/aplayer-js.html @@ -34,9 +34,6 @@ document.addEventListener("DOMContentLoaded", function () { }] }); - ap.on('play', () => umami?.track?.('🎵 Play music with aPlayer')); - ap.on('ended', () => umami?.track?.('🎵 Played entiresong with aPlayer')); - obs.unobserve(el); }); } diff --git a/static/_headers b/static/_headers index a96d80e5..2ef3aaa3 100644 --- a/static/_headers +++ b/static/_headers @@ -2,7 +2,6 @@ Content-Security-Policy: script-src 'self' https://remark.guhub.cn - https://umami.guhub.cn https://static.cloudflareinsights.com 'unsafe-inline' 'unsafe-eval'; diff --git a/static/graph.html b/static/graph.html index d122b049..9cc77cbc 100644 --- a/static/graph.html +++ b/static/graph.html @@ -17,7 +17,6 @@ border: 1px solid #444; } -
    @@ -72,7 +71,6 @@ const node = nodes.get(params.nodes[0]); if (node.url) { window.open(node.url, "_blank"); - umami.track('Visit page through Graph') } } }); -- cgit v1.2.3