fixed isActive in sidebar

This commit is contained in:
2024-02-11 02:37:59 +01:00
parent af2aab301c
commit 058533eb82
2 changed files with 3 additions and 2 deletions

View File

@@ -32,9 +32,9 @@ const docs = unsortedDocs.sort((a) =>
{ {
docs.map((page) => { docs.map((page) => {
const isActive = const isActive =
Astro.url.pathname == page.url ||
(Astro.url.pathname.startsWith(page.url) && (Astro.url.pathname.startsWith(page.url) &&
page.url !== "/docs/" + page.frontmatter.repo) || page.url !== "/docs/" + page.frontmatter.repo + "/");
Astro.url.pathname === page.url;
return ( return (
<a href={page.url} class={isActive ? "active" : ""}> <a href={page.url} class={isActive ? "active" : ""}>
<Icon name="mdi:file-outline" /> <Icon name="mdi:file-outline" />

View File

@@ -1,4 +1,5 @@
.donation-callout { .donation-callout {
position: sticky;
text-align: right; text-align: right;
.donation-text { .donation-text {
display: flex; display: flex;