feat: move routes to slugs

This commit is contained in:
2026-09-27 16:35:27 +05:00
parent 9776e1d325
commit d09c954694
8 changed files with 25 additions and 26 deletions
-11
View File
@@ -1,11 +0,0 @@
import { PAGES } from "$lib/registry";
export const prerender = true;
export function entries() {
return PAGES.map((page) => ({ id: page.slug }));
}
export function load({ params }: { params: { id: string } }) {
return { id: params.id };
}
@@ -6,11 +6,11 @@
import { SlidersHorizontal as ToolIcon } from "@lucide/svelte";
interface Props {
data: { id: string };
data: { slug: string };
}
let { data }: Props = $props();
const page = $derived(getPageBySlug(data.id));
const page = $derived(getPageBySlug(data.slug));
const tool = $derived(page ? getTool(page.steps[0].id) : undefined);
</script>
@@ -23,7 +23,7 @@
<div class="notfound">
<EmptyState
title={t("errors.notFound")}
description={t("errors.toolUnknown", { id: data.id })}
description={t("errors.pageUnknown", { slug: data.slug })}
icon={ToolIcon}
/>
</div>
+11
View File
@@ -0,0 +1,11 @@
import { PAGES } from "$lib/registry";
export const prerender = true;
export function entries() {
return PAGES.map((page) => ({ slug: page.slug }));
}
export function load({ params }: { params: { slug: string } }) {
return { slug: params.slug };
}