aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2025-06-10 23:09:34 +0300
committerValentin Popov <valentin@popov.link>2025-06-10 23:09:34 +0300
commit118112f0b747ca7d86310db81e8620b811eb0f57 (patch)
tree597e9d1eb0f7b291e661a0d48af93ab1d29765c3 /src
parent47a0acab13e2c7f55d4a600256c29ecca54fa3f3 (diff)
downloadpopov.link-118112f0b747ca7d86310db81e8620b811eb0f57.tar.xz
popov.link-118112f0b747ca7d86310db81e8620b811eb0f57.zip
refactor: simplify Analytics component and update BaseLayoutheader
- Removed props from the Analytics component to streamline its usage. - Updated BaseLayout to call Analytics without passing the title prop, ensuring default values are used.
Diffstat (limited to 'src')
-rw-r--r--src/components/Analytics.astro15
-rw-r--r--src/layouts/BaseLayout.astro4
2 files changed, 2 insertions, 17 deletions
diff --git a/src/components/Analytics.astro b/src/components/Analytics.astro
index 428ad4f..8235dea 100644
--- a/src/components/Analytics.astro
+++ b/src/components/Analytics.astro
@@ -1,17 +1,2 @@
----
-type Props = {
- readonly title: string;
-};
-
-const path = Astro.url.pathname;
-const { title } = Astro.props;
----
-
<!-- AppMetrix -->
<script is:inline src="https://appmetrix.com/pixel/T5X0z12SoASBV8Dv"></script>
-
-<!-- GoatCounter -->
-<script is:inline data-goatcounter="https://analytics.popov.link/count" src="//gc.zgo.at/count.js"></script>
-<noscript>
- <img alt="pixel" src={`https://analytics.popov.link/count?p=${encodeURI(path)}&t=${encodeURI(title)}`} />
-</noscript>
diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro
index 0209c58..8ed13fd 100644
--- a/src/layouts/BaseLayout.astro
+++ b/src/layouts/BaseLayout.astro
@@ -14,8 +14,8 @@ const { description, title } = Astro.props;
<html lang="ru">
<Head
- description={description ?? import.meta.env.DEFAULT_DESCRIPTION}
title={title ?? import.meta.env.DEFAULT_TITLE}
+ description={description ?? import.meta.env.DEFAULT_DESCRIPTION}
/>
<body>
@@ -26,6 +26,6 @@ const { description, title } = Astro.props;
<slot />
</main>
- <Analytics title={title ?? import.meta.env.DEFAULT_TITLE} />
+ <Analytics />
</body>
</html>