Skip to content

Commit

Permalink
fix relativity bug by normalizing paths
Browse files Browse the repository at this point in the history
  • Loading branch information
KTibow committed Dec 13, 2024
1 parent 0b01974 commit af1d8bc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"devDependencies": {
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.9.0",
"@sveltejs/kit": "^2.11.1",
"@sveltejs/package": "^2.3.7",
"@sveltejs/vite-plugin-svelte": "^5.0.1",
"@typescript-eslint/eslint-plugin": "^8.16.0",
Expand Down
25 changes: 16 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,26 @@
<div class="items">
{#each paths as { path, icon, iconS, label }}
{@const selected = normalizePath(path) === normalizePath($page.url.pathname)}
<NavListLink type="auto" href={path} {selected} icon={selected ? iconS : icon}>
<NavListLink
type="auto"
href={normalizePath(path)}
{selected}
icon={selected ? iconS : icon}
>
{label}
</NavListLink>
{/each}
<NavListLink
type="auto"
href={base + "/docs/quick-start"}
href={normalizePath(base + "/docs/quick-start")}
selected={$page.url.pathname.startsWith(base + "/docs")}
icon={$page.url.pathname.startsWith(base + "/docs") ? iconBookS : iconBook}
>
Docs
</NavListLink>
<NavListLink
type="auto"
href={base + "/transitions"}
href={normalizePath(base + "/transitions")}
selected={$page.url.pathname.startsWith(base + "/transitions")}
icon={$page.url.pathname.startsWith(base + "/transitions")
? iconAnimationS
Expand Down

0 comments on commit af1d8bc

Please sign in to comment.