diff --git a/src/hooks.ts b/src/hooks.ts new file mode 100644 index 0000000..7ea2285 --- /dev/null +++ b/src/hooks.ts @@ -0,0 +1,11 @@ +import type { Reroute } from '@sveltejs/kit'; + +const translated: Record = { + '/post': '/page/1', +}; + +export const reroute: Reroute = ({ url }) => { + if (url.pathname in translated) { + return translated[url.pathname]; + } +}; diff --git a/src/lib/components/PostHeader.svelte b/src/lib/components/PostHeader.svelte index 8911892..0d01ff6 100644 --- a/src/lib/components/PostHeader.svelte +++ b/src/lib/components/PostHeader.svelte @@ -35,7 +35,7 @@