link tracking
This commit is contained in:
parent
9ec025b24c
commit
d6bec835ef
2 changed files with 10 additions and 14 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue