fix: removed umami event because it caused page switching to be slower

This commit is contained in:
Guoqi Sun 2025-01-13 03:10:20 +08:00
parent 4051342900
commit 55f81243b2
9 changed files with 6 additions and 31 deletions

View file

@ -4,7 +4,7 @@ A minimalism, personal blog theme for Astro.
> If you find this project helpful, please consider giving it a star ⭐️ > If you find this project helpful, please consider giving it a star ⭐️
[![Built with Astro](https://astro.badg.es/v1/built-with-astro/tiny.svg)](https://astro.build) [![Netlify Status](https://api.netlify.com/api/v1/badges/a4eb6e88-606d-4ea6-9a53-179e03a7e2ef/deploy-status)](https://app.netlify.com/sites/astro-air/deploys) [![Built with Astro](https://astro.badg.es/v1/built-with-astro/tiny.svg)](https://astro.build) [![Netlify Status](https://api.netlify.com/api/v1/badges/3e2c71b9-071f-4846-9321-41c949134ebf/deploy-status)](https://app.netlify.com/sites/astro-air/deploys)
<img style="border-radius: 10px;" src="https://cdn.jsdelivr.net/gh/sun0225SUN/astro-air/public/preview.png" alt="Astro Air"> <img style="border-radius: 10px;" src="https://cdn.jsdelivr.net/gh/sun0225SUN/astro-air/public/preview.png" alt="Astro Air">

View file

@ -13,7 +13,7 @@ import robotsTxt from "astro-robots-txt"
export default defineConfig({ export default defineConfig({
output: "static", output: "static",
prefetch: true, prefetch: true,
site: "https://astro-air.netlify.app", site: "https://astro-air.guoqi.dev",
vite: { vite: {
worker: { worker: {
plugins: () => [], plugins: () => [],

View file

@ -24,7 +24,6 @@ const currentYear = new Date().getFullYear()
<a <a
href={item.link} href={item.link}
class="text-blue-600 transition-colors duration-200 hover:text-blue-800" class="text-blue-600 transition-colors duration-200 hover:text-blue-800"
data-umami-event={`footer-${item.label}`}
> >
{item.label} {item.label}
</a> </a>

View file

@ -10,24 +10,14 @@ const config = lang === "zh" ? zh : en
--- ---
<header class="flex h-24 w-full items-center justify-between"> <header class="flex h-24 w-full items-center justify-between">
<a <a href="/" aria-label={`${config.siteName} - 首页`}>
href="/"
data-umami-event="site-name"
aria-label={`${config.siteName} - 首页`}
>
<div class="text-2xl font-semibold">{config.siteName}</div> <div class="text-2xl font-semibold">{config.siteName}</div>
</a> </a>
<div class="flex items-center gap-6"> <div class="flex items-center gap-6">
{ {
config.rss && ( config.rss && (
<a <a href="/atom.xml" target="_blank" aria-label="RSS" title="RSS">
href="/atom.xml"
target="_blank"
data-umami-event="rss"
aria-label="RSS"
title="RSS"
>
<Rss /> <Rss />
</a> </a>
) )
@ -38,7 +28,6 @@ const config = lang === "zh" ? zh : en
href={social.link} href={social.link}
target="_blank" target="_blank"
class="hidden md:block" class="hidden md:block"
data-umami-event={social.label}
aria-label={social.label} aria-label={social.label}
title={social.label} title={social.label}
> >

View file

@ -17,7 +17,6 @@ const { home, archive, custom, links, about } =
<a <a
href={`/${lang}`} href={`/${lang}`}
class="hover:underline hover:underline-offset-4" class="hover:underline hover:underline-offset-4"
data-umami-event="nav-home"
aria-label={t("nav.home")} aria-label={t("nav.home")}
title={t("nav.home")} title={t("nav.home")}
data-astro-prefetch="viewport" data-astro-prefetch="viewport"
@ -31,7 +30,6 @@ const { home, archive, custom, links, about } =
<a <a
href={`/${lang}/archive`} href={`/${lang}/archive`}
class="hover:underline hover:underline-offset-4" class="hover:underline hover:underline-offset-4"
data-umami-event="nav-archive"
aria-label={t("nav.archive")} aria-label={t("nav.archive")}
title={t("nav.archive")} title={t("nav.archive")}
data-astro-prefetch="viewport" data-astro-prefetch="viewport"
@ -46,7 +44,6 @@ const { home, archive, custom, links, about } =
href={tab.link} href={tab.link}
class="hover:underline hover:underline-offset-4" class="hover:underline hover:underline-offset-4"
target="_blank" target="_blank"
data-umami-event={`nav-${tab.label}`}
aria-label={tab.label} aria-label={tab.label}
title={tab.label} title={tab.label}
data-astro-prefetch="viewport" data-astro-prefetch="viewport"
@ -60,7 +57,6 @@ const { home, archive, custom, links, about } =
<a <a
href={`/${lang}/links`} href={`/${lang}/links`}
class="hover:underline hover:underline-offset-4" class="hover:underline hover:underline-offset-4"
data-umami-event="nav-links"
aria-label={t("nav.links")} aria-label={t("nav.links")}
title={t("nav.links")} title={t("nav.links")}
data-astro-prefetch="viewport" data-astro-prefetch="viewport"
@ -74,7 +70,6 @@ const { home, archive, custom, links, about } =
<a <a
href={`/${lang}/about`} href={`/${lang}/about`}
class="hover:underline hover:underline-offset-4" class="hover:underline hover:underline-offset-4"
data-umami-event="nav-about"
aria-label={t("nav.about")} aria-label={t("nav.about")}
title={t("nav.about")} title={t("nav.about")}
data-astro-prefetch="viewport" data-astro-prefetch="viewport"

View file

@ -12,7 +12,6 @@ import { formatDate } from "~/utils"
<a <a
href={`/${lang}/posts/${post.id}/`} href={`/${lang}/posts/${post.id}/`}
data-umami-event={`post-${post.id}`}
class="my-3 flex visited:text-purple-500/90 md:my-2" class="my-3 flex visited:text-purple-500/90 md:my-2"
> >
<p <p

View file

@ -11,11 +11,5 @@ export function LanguageToggle() {
window.location.href = newPath window.location.href = newPath
} }
return ( return <Languages className="cursor-pointer" onClick={handleLanguageToggle} />
<Languages
className="cursor-pointer"
data-umami-event="language-toggle"
onClick={handleLanguageToggle}
/>
)
} }

View file

@ -29,7 +29,6 @@ export function ThemeToggle() {
return ( return (
<button <button
onClick={handleToggleClick} onClick={handleToggleClick}
data-umami-event="theme-toggle"
aria-label="Toggle theme" aria-label="Toggle theme"
title="Toggle theme" title="Toggle theme"
> >

View file

@ -20,7 +20,7 @@ const config = lang === "zh" ? zh : en
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href={config.meta.favicon} /> <link rel="icon" type="image/png" href={config.meta.favicon} />
<title> <title>
{ {
title title