Skip to content

Commit b72fa3f

Browse files
Copilotteemingc
andcommitted
Use get_topic_title helper instead of duplicating logic
Co-authored-by: teemingc <[email protected]>
1 parent bb1687f commit b72fa3f

File tree

1 file changed

+2
-9
lines changed
  • apps/svelte.dev/src/routes/docs/[topic]/[...path]

1 file changed

+2
-9
lines changed

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import { goto } from '$app/navigation';
1010
import { escape_html } from '$lib/utils/escape';
1111
import { page } from '$app/state';
12+
import { get_topic_title } from '$lib/server/llms';
1213
1314
let { data } = $props();
1415
@@ -22,15 +23,7 @@
2223
return `https://github.com/sveltejs/${name}/edit/main/documentation/${link}`;
2324
});
2425
25-
// Map topic slug to readable title
26-
const topicTitles: Record<string, string> = {
27-
svelte: 'Svelte',
28-
kit: 'SvelteKit',
29-
cli: 'Svelte CLI',
30-
mcp: 'Svelte MCP'
31-
};
32-
33-
const topicTitle = $derived(topicTitles[page.params.topic] || 'Svelte');
26+
const topicTitle = $derived(get_topic_title(page.params.topic));
3427
3528
onMount(() => {
3629
// hash was lowercase in v4 docs and varying case in v5 docs

0 commit comments

Comments
 (0)