Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/routes/llms-full.txt/+server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { components, categoryOf } from '../components/catalog.js';
import { componentDocs, type PropDoc } from '../components/props.server.js';
import { site } from '../seo.js';
import { categoryNames, templates } from '../templates/registry.js';

export const prerender = true;

Expand Down Expand Up @@ -115,6 +116,24 @@ export function GET() {
}
}

parts.push(
'## Templates',
'',
'Whole screens built from the components above. Each is a single Svelte file; the',
'source is on its page.',
''
);
for (const template of templates) {
parts.push(
`### ${template.title}`,
'',
...(template.description ? [template.description, ''] : []),
`Category: ${categoryNames[template.category]}. Page: ${site.url}/templates/${template.slug}`,
...(template.uses.length ? ['', `Uses: ${template.uses.join(', ')}`] : []),
''
);
}

return new Response(parts.join('\n'), {
headers: { 'content-type': 'text/plain; charset=utf-8' }
});
Expand Down
13 changes: 13 additions & 0 deletions src/routes/llms.txt/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { grouped } from '../components/catalog.js';
import { site } from '../seo.js';
import { categories, templates } from '../templates/registry.js';

export const prerender = true;

Expand All @@ -24,6 +25,7 @@ export function GET() {
`- [How it compares](${site.url}/docs/comparison): next to shadcn-svelte, Bits UI and Skeleton, with measured bundle sizes`,
`- [Component index](${site.url}/components): all components with examples and props`,
`- [Theme generator](${site.url}/themes): generate a palette and copy the CSS`,
`- [Templates](${site.url}/templates): whole screens built from the kit, one Svelte file each`,
`- [Full API as one file](${site.url}/llms-full.txt): every component, prop, default and keyboard shortcut`
]),
...grouped.map((group) =>
Expand All @@ -33,6 +35,17 @@ export function GET() {
(item) => `- [${item.name}](${site.url}/components/${item.slug}): ${item.summary}`
)
)
),
...categories.map((category) =>
section(
`Templates: ${category.name}`,
templates
.filter((template) => template.category === category.slug)
.map(
(template) =>
`- [${template.title}](${site.url}/templates/${template.slug})${template.description ? `: ${template.description}` : ''}`
)
)
)
].join('\n');

Expand Down
Loading