Skip to content

Commit 9ed447e

Browse files
tomoamdummdidumm
andauthored
fix: correct redirection for examples/[...path] (#1130)
* fix: correct redirection for examples/[...path] * Update apps/svelte.dev/src/hooks.server.js * move redirect-logic to hooks --------- Co-authored-by: Simon H <[email protected]>
1 parent ee3d65d commit 9ed447e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

apps/svelte.dev/src/hooks.server.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ export async function handle({ event, resolve }) {
6161
redirect(307, event.url.pathname.replace('/repl', '/playground'));
6262
}
6363

64+
// For examples
65+
if (event.url.pathname.startsWith('/examples')) {
66+
redirect(307, event.url.pathname.replace('/examples', '/playground'));
67+
}
68+
6469
// Best effort to redirect from Svelte 3 tutorial to new tutorial
6570
if (event.url.pathname.startsWith('/tutorial/') && event.url.pathname.split('/').length === 2) {
6671
redirect(307, event.url.pathname.replace('/tutorial/', '/tutorial/svelte/'));

apps/svelte.dev/src/routes/examples/[...path]/+page.server.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)