feat: kanporako link-ak ezberdintzen ditu

This commit is contained in:
txarli committed 2026-11-19 18:54:25 +01:00
1 parent ecdbecae3f
commit 6d297f7cbe
3 files changed
+50 -32

No files matched your search

+17 -13
View File
@@ -4,21 +4,25 @@ import { SITE_TITLE, SITE_DESCRIPTION } from "../config";
---
<header>
<div class="header-section">
<div class="header-frame">
<h1>{SITE_TITLE}</h1>
<h2>{SITE_DESCRIPTION}</h2>
</div>
</div>
<div class="header-section">
<div class="header-frame">
<h1>{SITE_TITLE}</h1>
<h2>{SITE_DESCRIPTION}</h2>
</div>
</div>
</header>
<nav>
<HeaderLink href="/">hasiera</HeaderLink>
<HeaderLink href="/post">postak</HeaderLink>
<HeaderLink href="https://sayagata.txarli.dev">sayagata</HeaderLink>
<HeaderLink href="https://mastodon.eus/@txarli" rel="me">mastodon</HeaderLink>
<HeaderLink href="/">hasiera</HeaderLink>
<HeaderLink href="/post">postak</HeaderLink>
<HeaderLink isExternal href="https://sayagata.txarli.dev">sayagata</HeaderLink
>
<HeaderLink isExternal href="https://git.fosil.eu/txarli">git</HeaderLink>
<HeaderLink isExternal href="https://mastodon.eus/@txarli" rel="me"
>mastodon</HeaderLink
>
</nav>
<style>
h2 {
margin: 0.5em 0;
}
h2 {
margin: 0.5em 0;
}
</style>
+28 -19
View File
@@ -1,28 +1,37 @@
---
const { href, class: className, ...props } = Astro.props;
let isActive: boolean;
import ExternalIcon from "./assets/external.svg";
if (href === "/") {
isActive = Astro.url.pathname === href;
} else {
isActive = Astro.url.pathname.startsWith(href);
}
const { href, isExternal, class: className, ...props } = Astro.props;
const isActive =
href === "/"
? Astro.url.pathname === href
: Astro.url.pathname.startsWith(href);
---
<a href={href} class:list={[className, { active: isActive }]} {...props}>
<slot />
<a
href={href}
class:list={[className, { active: isActive, external: isExternal }]}
{...props}
>
<slot />
{isExternal && <ExternalIcon />}
</a>
<style>
a {
display: inline-block;
text-decoration: none;
}
a.active {
font-weight: bolder;
text-decoration: underline;
text-decoration-thickness: 0.3ex;
text-underline-offset: 0.3ex;
}
a {
display: inline-flex;
text-decoration: none;
align-items: center;
}
a.active {
font-weight: bolder;
text-decoration: underline;
text-decoration-thickness: 0.3ex;
text-underline-offset: 0.3ex;
}
a.external {
font-style: italic;
}
</style>
+5
View File
@@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none" />
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 5H8.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C5 6.52 5 7.08 5 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874c.427.218.987.218 2.105.218h7.606c1.118 0 1.677 0 2.104-.218c.377-.192.683-.498.875-.874c.218-.428.218-.987.218-2.105V14m1-5V4m0 0h-5m5 0l-7 7" />
</svg>

After

Width:  |  Height:  |  Size: 521 B