diff --git a/sites/svelte.dev/src/routes/docs/+page.svelte b/sites/svelte.dev/src/routes/docs/+page.svelte index ecf250461d..621f355802 100644 --- a/sites/svelte.dev/src/routes/docs/+page.svelte +++ b/sites/svelte.dev/src/routes/docs/+page.svelte @@ -11,15 +11,15 @@ $page.url.hash.replace('#', '').startsWith(val.path.split('/').at(-1)) ); - if (!section) goto('/docs/introduction'); + if (!section) return '/docs/introduction'; // Remove the section name from hash, then redirect to that const hash = $page.url.hash.replace(`#${section.path.split('/').at(-1)}-`, ''); - goto(`${section.path}#${hash}`); + return `${section.path}#${hash}`; } onMount(() => { - getURlToRedirectTo(); + goto(getURlToRedirectTo()); });