Skip to content

Commit 84ed768

Browse files
committed
move template into separate .md file
1 parent aa3a4e6 commit 84ed768

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

apps/svelte.dev/src/routes/llms.txt/+server.ts

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,17 @@
11
import { get_documentation_title, sections } from '$lib/server/llms';
2+
import template from './template.md?raw';
23

34
const DOMAIN = `https://svelte.dev`;
45

56
export const prerender = true;
67

78
export function GET() {
8-
const package_docs = sections
9-
.map(
10-
(section) =>
11-
`- [${section.title} documentation](${DOMAIN}/docs/${section.slug}/llms.txt): ${get_documentation_title(section)}`
12-
)
13-
.join('\n');
9+
const package_docs = sections.map(
10+
(section) =>
11+
`- [${section.title} documentation](${DOMAIN}/docs/${section.slug}/llms.txt): ${get_documentation_title(section)}`
12+
);
1413

15-
const content = `# Svelte Documentation for LLMs
16-
17-
> Svelte is a UI framework that uses a compiler to let you write breathtakingly concise components that do minimal work in the browser, using languages you already know — HTML, CSS and JavaScript.
18-
19-
## Documentation Sets
20-
21-
- [Abridged documentation](${DOMAIN}/llms-small.txt): A minimal version of the Svelte and SvelteKit documentation, with examples and non-essential content removed
22-
- [Complete documentation](${DOMAIN}/llms-full.txt): The complete Svelte and SvelteKit documentation including all examples and additional content
23-
24-
## Individual Package Documentation
25-
26-
${package_docs}
27-
28-
## Notes
29-
30-
- The abridged documentation excludes legacy compatibility notes, detailed examples, and supplementary information
31-
- The complete documentation includes all content from the official documentation
32-
- Package-specific documentation files contain only the content relevant to that package
33-
- The content is automatically generated from the same source as the official documentation`;
14+
const content = template.replace('%PACKAGE_DOCS%', package_docs.join('\n'));
3415

3516
return new Response(content, {
3617
headers: {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Svelte Documentation for LLMs
2+
3+
> Svelte is a UI framework that uses a compiler to let you write breathtakingly concise components that do minimal work in the browser, using languages you already know — HTML, CSS and JavaScript.
4+
5+
## Documentation Sets
6+
7+
- [Abridged documentation](https://svelte.dev/llms-small.txt): A minimal version of the Svelte and SvelteKit documentation, with examples and non-essential content removed
8+
- [Complete documentation](https://svelte.dev/llms-full.txt): The complete Svelte and SvelteKit documentation including all examples and additional content
9+
10+
## Individual Package Documentation
11+
12+
%PACKAGE_DOCS%
13+
14+
## Notes
15+
16+
- The abridged documentation excludes legacy compatibility notes, detailed examples, and supplementary information
17+
- The complete documentation includes all content from the official documentation
18+
- Package-specific documentation files contain only the content relevant to that package
19+
- The content is automatically generated from the same source as the official documentation

0 commit comments

Comments
 (0)