Skip to content

Commit d41e35d

Browse files
authored
feat(docs): add /llms.txt for LLM-friendly site context (#7)
feat(docs): add /llms.txt with sidebar link Auto-generates from registry.json. Added to Getting Started nav. Co-authored-by: Justin Levine <20596508+justinlevinedotme@users.noreply.github.com>
1 parent f952f43 commit d41e35d

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

app/llms.txt/route.ts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import { NextResponse } from "next/server"
2+
import registry from "@/registry.json"
3+
4+
export const dynamic = "force-static"
5+
6+
export function GET() {
7+
const items = registry.items
8+
9+
const componentLines = items
10+
.map((item) => {
11+
const url = `https://ui.justinlevine.me/docs/components/${item.name}`
12+
return `- [${item.title}](${url}): ${item.description}`
13+
})
14+
.join("\n")
15+
16+
const registryLines = items
17+
.map((item) => {
18+
return `- [${item.name}.json](https://ui.justinlevine.me/r/${item.name}.json): Registry JSON for ${item.title}`
19+
})
20+
.join("\n")
21+
22+
const body = `# jal-co/ui
23+
24+
> jalco ui is a React component library by Justin Levine. It ships polished, composable components for React and Next.js projects, distributed via a shadcn-compatible registry. Install any component with a single command or copy the source directly.
25+
26+
## Install
27+
28+
Components are installed using the shadcn CLI. No npm package to install — each component is copied into your project as source code.
29+
30+
\`\`\`
31+
npx shadcn@latest add https://ui.justinlevine.me/r/<component-name>.json
32+
\`\`\`
33+
34+
Replace \`<component-name>\` with any component name listed below.
35+
36+
## Key details
37+
38+
- Built with React 19, Next.js 15, Tailwind CSS v4, and Radix UI primitives
39+
- All components are server-component-first where possible
40+
- No wrapper package — components are copied as source into your project
41+
- Uses class-variance-authority for variant systems
42+
- Designed for accessibility, composability, and copy-paste ergonomics
43+
- Source: https://github.com/jal-co/ui
44+
45+
## Components
46+
47+
${componentLines}
48+
49+
## Registry JSON
50+
51+
${registryLines}
52+
53+
## Optional
54+
55+
- [Installation guide](https://ui.justinlevine.me/docs/installation): How to set up jalco ui in a new or existing project
56+
- [Color Themes](https://ui.justinlevine.me/docs/themes): Available color themes and how to customize them
57+
- [GitHub](https://github.com/jal-co/ui): Source code repository
58+
`
59+
60+
return new NextResponse(body, {
61+
headers: {
62+
"Content-Type": "text/plain; charset=utf-8",
63+
"Cache-Control": "public, max-age=3600",
64+
},
65+
})
66+
}

lib/docs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const docsNav: NavGroup[] = [
3737
{ title: "Components", href: "/docs" },
3838
{ title: "Installation", href: "/docs/installation" },
3939
{ title: "Color Themes", href: "/docs/themes" },
40+
{ title: "llms.txt", href: "/llms.txt" },
4041
],
4142
},
4243
{

0 commit comments

Comments
 (0)