Skip to content

Commit 92b868f

Browse files
committed
fix
1 parent 664f0d5 commit 92b868f

File tree

1 file changed

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

1 file changed

+5
-2
lines changed

apps/svelte.dev/src/routes/docs/[topic]/[...path]/llms.txt/+server.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ import { generate_llm_content, get_documentation_title, sections } from '$lib/se
44
export const prerender = true;
55

66
export function entries() {
7-
return sections.map((section) => ({ path: section.slug }));
7+
return sections.map((section) => {
8+
const [topic, ...rest] = section.slug.split('/');
9+
return { topic, path: rest.join('/') };
10+
});
811
}
912

1013
export function GET({ params }) {
11-
const pkg = `${params.topic}/${params.path}`;
14+
const pkg = params.path ? `${params.topic}/${params.path}` : params.topic;
1215

1316
const section = sections.find((s) => s.slug === pkg);
1417

0 commit comments

Comments
 (0)