Reapply "fix: navigation issues (#57)"

This reverts commit 2d3e3b9493.
This commit is contained in:
not-nullptr 2025-04-13 13:50:48 +01:00
parent 2d3e3b9493
commit a86c00abf3
3 changed files with 10 additions and 4 deletions

View File

@ -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 {

View File

@ -14,3 +14,4 @@ export const load = ({ data }) => {
};
export const prerender = true;
export const trailingSlash = "always";

View File

@ -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_",