2 Commits

Author SHA1 Message Date
118112f0b7 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.
2025-06-10 20:09:34 +00:00
47a0acab13 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.
2025-06-10 18:36:35 +00:00
6 changed files with 25 additions and 24 deletions

View File

@@ -1,17 +1,2 @@
---
type Props = {
readonly title: string;
};
const path = Astro.url.pathname;
const { title } = Astro.props;
---
<!-- AppMetrix --> <!-- AppMetrix -->
<script is:inline src="https://appmetrix.com/pixel/T5X0z12SoASBV8Dv"></script> <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>

View File

@@ -3,12 +3,25 @@
header { header {
padding-bottom: 1rem; padding-bottom: 1rem;
position: relative;
}
.site-title {
color: $colorText;
font-weight: bold;
left: 0;
position: absolute;
text-decoration: none;
top: 0;
}
.nav-links {
text-align: right; text-align: right;
} }
a { a {
text-decoration: none;
margin-right: 1.5rem; margin-right: 1.5rem;
text-decoration: none;
&:last-child { &:last-child {
margin-right: 0; margin-right: 0;
@@ -17,6 +30,9 @@
</style> </style>
<header> <header>
<a class="site-title" href="/">{import.meta.env.DEFAULT_TITLE}</a>
<div class="nav-links">
<a href="/">Home</a> <a href="/">Home</a>
<a href="/blog/">Blog</a> <a href="/blog/">Blog</a>
</div>
</header> </header>

View File

@@ -14,8 +14,8 @@ const { description, title } = Astro.props;
<html lang="ru"> <html lang="ru">
<Head <Head
description={description ?? import.meta.env.DEFAULT_DESCRIPTION}
title={title ?? import.meta.env.DEFAULT_TITLE} title={title ?? import.meta.env.DEFAULT_TITLE}
description={description ?? import.meta.env.DEFAULT_DESCRIPTION}
/> />
<body> <body>
@@ -26,6 +26,6 @@ const { description, title } = Astro.props;
<slot /> <slot />
</main> </main>
<Analytics title={title ?? import.meta.env.DEFAULT_TITLE} /> <Analytics />
</body> </body>
</html> </html>