Skip to content

Commit 6004e83

Browse files
committed
actually it looks like we do need this
1 parent 7da4f02 commit 6004e83

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/svelte.dev/src/routes/docs/[...path]/+page.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import OnThisPage from './OnThisPage.svelte';
77
import Breadcrumbs from './Breadcrumbs.svelte';
88
import PageControls from '$lib/components/PageControls.svelte';
9+
import { goto } from '$app/navigation';
910
1011
let { data } = $props();
1112
@@ -36,7 +37,10 @@
3637
for (const heading of content.querySelectorAll('[id]')) {
3738
// e.g. we want to redirect progressive-enhancement-use-enhance to Progressive-enhancement-use:enhance
3839
if (heading.id.toLowerCase().replaceAll(':', '-') === id) {
39-
location.hash = heading.id;
40+
goto(`#${heading.id}`, {
41+
replaceState: true
42+
});
43+
4044
break;
4145
}
4246
}

0 commit comments

Comments
 (0)