diff options
| -rw-r--r-- | assets/js/settings.js | 6 | ||||
| -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 | ||||
| -rw-r--r-- | static/_headers | 1 | ||||
| -rw-r--r-- | static/graph.html | 2 |
16 files changed, 8 insertions, 44 deletions
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 @@ -33,12 +33,6 @@ function initCheckboxes() { const checkboxOptions = [ { - id: 'dontAllowTracking', - label: '禁止网站使用 Web 分析工具跟踪用户行为', - storage: 'umami.disabled', - default: 'false' - }, - { id: 'hideBatrick', label: '隐藏 Batrick(返回顶部按钮)', storage: 'geedeapro.ui.hideBatrick', 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); }); } 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; } </style> - <script defer src="https://umami.guhub.cn/script.js" data-website-id="3bec51b2-739f-4a79-b030-ad2511d6f5a7"></script> </head> <body> <div id="graph"></div> @@ -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') } } }); |
