Skip to content

Commit 2c71df0

Browse files
authored
fix: correct redirects from v3 docs (sveltejs#598)
1 parent dcbf5f6 commit 2c71df0

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

apps/svelte.dev/src/routes/docs/+page.svelte

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@
77
// This mapping does a best effort to redirect to the new docs.
88
const mappings = [
99
['before-we-begin', 'overview'],
10-
['getting-started', 'getting-started'],
10+
['getting-started', 'overview'],
1111
['component-format', 'svelte-files'],
12-
['template-syntax-if', 'control-flow'],
13-
['template-syntax-each', 'control-flow'],
14-
['template-syntax-await', 'control-flow'],
15-
['template-syntax-key', 'control-flow'],
12+
['template-syntax-if', 'if'],
13+
['template-syntax-each', 'each'],
14+
['template-syntax-await', 'await'],
15+
['template-syntax-key', 'key'],
1616
['template-syntax-element-directives', 'basic-markup'],
1717
['template-syntax-element-directives-bind', 'bindings'],
18-
['template-syntax-element-directives-class', 'styles-and-classes'],
19-
['template-syntax-element-directives-style', 'styles-and-classes'],
20-
['template-syntax-element-directives-use-action', 'actions'],
21-
['template-syntax-element-directives-transition-fn', 'transitions-and-animations'],
22-
['template-syntax-element-directives-in-fn-out-fn', 'transitions-and-animations'],
23-
['template-syntax-element-directives-animate-fn', 'transitions-and-animations'],
24-
['template-syntax-component-directives', 'component fundamentals'],
25-
['template-syntax-svelte', 'special-elements'],
18+
['template-syntax-element-directives-class', 'class'],
19+
['template-syntax-element-directives-style', 'style'],
20+
['template-syntax-element-directives-use-action', 'use'],
21+
['template-syntax-element-directives-transition-fn', 'transition'],
22+
['template-syntax-element-directives-in-fn-out-fn', 'in-and-out'],
23+
['template-syntax-element-directives-animate-fn', 'animate'],
24+
['template-syntax-component-directives', 'basic-markup'],
25+
// not sure what lived here
26+
// if I guessed right, there's not a great one for this
27+
['template-syntax-svelte', 'svelte-window'],
2628
['template-syntax', 'basic-markup'],
2729
['run-time-svelte-store', 'svelte-store'],
2830
['run-time-svelte-motion', 'svelte-motion'],
@@ -44,7 +46,7 @@
4446
if (!hash) return;
4547
4648
for (const [old_id, new_id] of mappings) {
47-
if (hash.startsWith(old_id)) return `/docs/svelte/${new_id}`;
49+
if (hash === old_id) return `/docs/svelte/${new_id}`;
4850
}
4951
}
5052

0 commit comments

Comments
 (0)