feature: add sv-router, page structure and redirect to home from any other page

This commit is contained in:
Ilia Mashkov
2026-05-30 18:31:56 +03:00
parent eb5a8d1e5b
commit f6911fbcca
7 changed files with 64 additions and 8 deletions
+23
View File
@@ -0,0 +1,23 @@
import { createRouter } from 'sv-router';
import Home from './Home.svelte';
import Redirect from './Redirect.svelte';
/**
* Single-page router for glyphdiff.
*
* Currently exposes one route; structure exists so additional routes can be
* added without touching the app shell.
*/
export const {
isActive,
navigate,
p,
preload,
route,
} = createRouter({
'/': Home,
/**
* Any unmatched path redirects to home until additional routes exist.
*/
'*notfound': Redirect,
});