aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2025-06-10 23:12:57 +0300
committerGitHub <noreply@github.com>2025-06-10 23:12:57 +0300
commit77e65cb92c258752f57b37fc4e57424debe06744 (patch)
tree597e9d1eb0f7b291e661a0d48af93ab1d29765c3
parent34ce9f6162ae4ff2d0278760cce28227d82433ed (diff)
downloadpopov.link-77e65cb92c258752f57b37fc4e57424debe06744.tar.xz
popov.link-77e65cb92c258752f57b37fc4e57424debe06744.zip
refactor: simplify Analytics component and update BaseLayout
* style: enhance Header component and update SCSS imports - Improved the Header component by adding a site title with styling. - Wrapped navigation links in a div for better structure. - Updated SCSS imports across multiple components for consistency. * refactor: simplify Analytics component and update BaseLayout - 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.
-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>