From a86c00abf38960ee43e4139ca6e3d5a6be72f42c Mon Sep 17 00:00:00 2001 From: not-nullptr <62841684+not-nullptr@users.noreply.github.com> Date: Sun, 13 Apr 2025 13:50:48 +0100 Subject: [PATCH] Reapply "fix: navigation issues (#57)" This reverts commit 2d3e3b9493f5dd1bde32d164d1f56e73be474761. --- src/lib/components/layout/Navbar/Base.svelte | 10 ++++++---- src/routes/+layout.ts | 1 + svelte.config.js | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib/components/layout/Navbar/Base.svelte b/src/lib/components/layout/Navbar/Base.svelte index ee69a19..3b02dd1 100644 --- a/src/lib/components/layout/Navbar/Base.svelte +++ b/src/lib/components/layout/Navbar/Base.svelte @@ -39,20 +39,21 @@ }, { name: "Convert", - url: "/convert", - activeMatch: (pathname) => pathname === "/convert", + url: "/convert/", + activeMatch: (pathname) => + pathname === "/convert/" || pathname === "/convert", icon: RefreshCw, badge: files.files.length, }, { name: "Settings", - url: "/settings", + url: "/settings/", activeMatch: (pathname) => pathname.startsWith("/settings"), icon: SettingsIcon, }, { name: "About", - url: "/about", + url: "/about/", activeMatch: (pathname) => pathname.startsWith("/about"), icon: InfoIcon, }, @@ -78,6 +79,7 @@ const newIndex = items.findIndex((i) => i.activeMatch(e.to?.url.pathname || ""), ); + console.log(oldIndex, newIndex); if (newIndex < oldIndex) { goingLeft.set(true); } else { diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index a0bb4fa..fcc463c 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -14,3 +14,4 @@ export const load = ({ data }) => { }; export const prerender = true; +export const trailingSlash = "always"; diff --git a/svelte.config.js b/svelte.config.js index 76b86fe..0349799 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -12,6 +12,9 @@ const config = { // If your environment is not supported, or you settled on a specific environment, switch out the adapter. // See https://svelte.dev/docs/kit/adapters for more information about adapters. adapter: adapter(), + paths: { + relative: false, + }, env: { publicPrefix: "PUB_", privatePrefix: "PRI_",