link tracking

This commit is contained in:
bronku 2026-06-10 20:21:30 +02:00
parent 9ec025b24c
commit d6bec835ef
2 changed files with 10 additions and 14 deletions

View file

@ -54,7 +54,7 @@ body > nav {
text-decoration: none; text-decoration: none;
color: var(--on-background); color: var(--on-background);
&[href] { &[href]:not([aria-current="page"]) {
font-weight: 200; font-weight: 200;
transition: color 0.2s; transition: color 0.2s;
@ -63,7 +63,7 @@ body > nav {
} }
} }
&:not([href]) { &[aria-current="page"] {
padding-bottom: 8px; padding-bottom: 8px;
color: var(--primary); color: var(--primary);
border-bottom: 2px solid var(--primary); border-bottom: 2px solid var(--primary);

View file

@ -180,13 +180,11 @@ templ layout(activePage string) {
templ Link(activePage, targetPage, title string) { templ Link(activePage, targetPage, title string) {
<a <a
if activePage != targetPage {
if targetPage == "index" { if targetPage == "index" {
href="/" href="/"
} else { } else {
href={ fmt.Sprint("/", targetPage, "/") } href={ fmt.Sprint("/", targetPage, "/") }
} }
}
if activePage == targetPage { if activePage == targetPage {
aria-current="page" aria-current="page"
} }
@ -195,13 +193,11 @@ templ Link(activePage, targetPage, title string) {
templ GreenLink(activePage, targetPage, title string) { templ GreenLink(activePage, targetPage, title string) {
<a <a
if activePage != targetPage {
if targetPage == "index" { if targetPage == "index" {
href="/" href="/"
} else { } else {
href={ fmt.Sprint("/", targetPage, "/") } href={ fmt.Sprint("/", targetPage, "/") }
} }
}
if activePage == targetPage { if activePage == targetPage {
aria-current="page" aria-current="page"
} }