diff options
| author | Eltrac <hi@guhub.cn> | 2025-09-28 11:34:33 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-09-28 11:34:33 +0800 |
| commit | 99deb4bd1c115b5b11f3632ca57ccc4d41fb3ee9 (patch) | |
| tree | e2f80de07073e43f5a86da381fb1af2470455854 /layouts/_partials | |
| parent | 13314f3fc50484c3c6c628627fe49053a8284599 (diff) | |
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.
Diffstat (limited to 'layouts/_partials')
| -rw-r--r-- | layouts/_partials/head.html | 1 | ||||
| -rw-r--r-- | layouts/_partials/head/umami.html | 11 | ||||
| -rw-r--r-- | layouts/_partials/header/language-switch.html | 1 | ||||
| -rw-r--r-- | layouts/_partials/header/navigation.html | 1 | ||||
| -rw-r--r-- | layouts/_partials/home/home-nav-item.html | 3 | ||||
| -rw-r--r-- | layouts/_partials/home/home-nav.html | 3 | ||||
| -rw-r--r-- | layouts/_partials/home/latest-posts.html | 3 | ||||
| -rw-r--r-- | layouts/_partials/items/post-small.html | 2 | ||||
| -rw-r--r-- | layouts/_partials/items/post.html | 5 | ||||
| -rw-r--r-- | layouts/_partials/posts/action-menu/info-links.html | 4 | ||||
| -rw-r--r-- | layouts/_partials/posts/now-read-this.html | 2 | ||||
| -rw-r--r-- | layouts/_partials/scripts/action-menu-js.html | 4 | ||||
| -rw-r--r-- | layouts/_partials/scripts/aplayer-js.html | 3 |
13 files changed, 8 insertions, 35 deletions
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" . }} </head> 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 @@ -<!-- Umami Tracking --> -<script> - if (window.location.hostname !== 'localhost') { - // track traffic - const script = document.createElement('script'); - script.defer = true; - script.src = 'https://umami.guhub.cn/script.js'; - script.dataset.websiteId = '3bec51b2-739f-4a79-b030-ad2511d6f5a7'; - document.head.appendChild(script); - } -</script> 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 -}} <a href="{{ $entry.url }}" - data-umami-event="π Switch Language" class="rounded-full text-center hover:no-underline {{ $langButtonSize }} bg-neutral/10 border-1 border-[var(--text-color)] border-solid bg-[var(--block-background-color)] diff --git a/layouts/_partials/header/navigation.html b/layouts/_partials/header/navigation.html index b3e03aeb..0883206a 100644 --- a/layouts/_partials/header/navigation.html +++ b/layouts/_partials/header/navigation.html @@ -9,7 +9,6 @@ {{ end }}" href="{{ .link }}" target="{{ .target }}" - data-umami-event="π Click header navigation" >{{ .name }}</a> {{ end }} </nav> 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 }} <div class="flex-shrink-0 flex-grow-0"> - <a data-umami-event="π§ Click postnav link" - href="{{ .Site.LanguagePrefix }}/{{ $link }}" + <a href="{{ .Site.LanguagePrefix }}/{{ $link }}" class="texl-base md:text-lg relative px-2 py-1 hover:no-underline {{ if $active }}font-extrabold{{ end }}" diff --git a/layouts/_partials/home/home-nav.html b/layouts/_partials/home/home-nav.html index ce185a5f..e967b222 100644 --- a/layouts/_partials/home/home-nav.html +++ b/layouts/_partials/home/home-nav.html @@ -26,8 +26,7 @@ <a href="{{ .Site.LanguagePrefix }}/stats" data-tooltip="{{ T "statsTooltip" }}" class="block opacity-50 transition-opacity duration-300 hover:opacity-100 - {{ if eq "/stats/" $.Page.RelPermalink }} opacity-100 font-bolder{{ end }}" - data-umami-event="π Click stats page link"> + {{ if eq "/stats/" $.Page.RelPermalink }} opacity-100 font-bolder{{ end }}"> <img src="/img/graph.svg" class="opacity-50 h-8 w-8" alt="Cthulu-style monster with an eye." /> </a> <li> 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 }} </div> - <a href="/posts" class="small-button" - data-umami-event="β Click more posts link"> + <a href="/posts" class="small-button"> {{ T "moreLinks.posts" }} β </a> </section> 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 "稻θδΊΊε¨ε") }} <li class="flex justify-between text-size-lg {{ if $isWeekly }} weekly animate-duration-500 transition-opacity{{ end }}"> - <a href="{{ .RelPermalink }}" data-umami-event="ποΈ Click Post Link from Category Page"> + <a href="{{ .RelPermalink }}"> {{ .Title }}{{ with .Params.subtitle }}οΌ<span class="text-secondary">{{. }}</span> {{ end }} </a> 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 @@ </p> <h2 class="xerox" {{ if $showSummary }} style="margin-bottom: 0"{{ end }}> - <a - href="{{ .ctx.Permalink }}" - data-umami-event="π Click post link from index" - > + <a href="{{ .ctx.Permalink }}"> {{ 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 @@ <div class="flex gap-1"> <a href="https://t.me/geedeapro" target="_blank" data-tooltip class="dark:invert flex items-center justify-center gap-1.5 min-w-8 h-8 px-1 border-none bg-transparent text-gray-600 cursor-pointer relative transition-all duration-200 hover:opacity-70 group" - title="{{ T "actionMenu.telegramChannel" }}" data-umami-event="βοΈ Click Telegram link from post tabs"> + title="{{ T "actionMenu.telegramChannel" }}"> <img src="/img/radio.svg" width="16" height="16" alt="{{ T "actionMenu.telegramChannel" }}" class="brightness-40 flex-shrink-0 dark:brightness-70 dark:contrast-120" /> </a> <a href="/sponsor" data-tooltip class="dark:invert flex items-center justify-center gap-1.5 min-w-8 h-8 px-1 border-none bg-transparent text-gray-600 cursor-pointer relative transition-all duration-200 hover:opacity-70 group" - title="{{ T "actionMenu.sponsor" }}" data-umami-event="π Click sponsor button from post tabs"> + title="{{ T "actionMenu.sponsor" }}"> <img src="/img/coffee.svg" width="16" height="16" alt="{{ T "actionMenu.sponsor" }}" class="brightness-40 flex-shrink-0 dark:brightness-70 dark:contrast-120" /> 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 @@ <h4 class="absolute -z-1 bottom-0 right-0 text-8 m-0 opacity-25 font-italic">{{ T "nowReadThis" }}</h4> {{ range . }} <div class="flex justify-between"> - <a class="font-800" href="{{ .RelPermalink }}" data-umami-event="π€ Click Related Post"> + <a class="font-800" href="{{ .RelPermalink }}"> {{ .LinkTitle }} {{ with .Params.subtitle }} <span class="text-secondary font-normal">οΌ{{ . }}</span> 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); }); } |
