mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-11 09:51:40 +00:00
* feat: init * fix * fix * fix * feat * feat * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * feat: implement icons * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * feat: update init command * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * feat: dialog * feat * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * feat: add registry:base item type * feat: rename frame to canva * fix * feat * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fi * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * feat: add all colors * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * feat: add outfit font * fix * fix * fix * fix * fix * chore: changeset * fix * fix * fix * fix * fix * fix * fix * fix
37 lines
856 B
TypeScript
37 lines
856 B
TypeScript
import { notFound } from "next/navigation"
|
|
import { NextResponse, type NextRequest } from "next/server"
|
|
|
|
import { processMdxForLLMs } from "@/lib/llm"
|
|
import { source } from "@/lib/source"
|
|
import { getActiveStyle } from "@/registry/_legacy-styles"
|
|
|
|
export const revalidate = false
|
|
|
|
export async function GET(
|
|
_req: NextRequest,
|
|
{ params }: { params: Promise<{ slug?: string[] }> }
|
|
) {
|
|
const [{ slug }, activeStyle] = await Promise.all([params, getActiveStyle()])
|
|
|
|
const page = source.getPage(slug)
|
|
|
|
if (!page) {
|
|
notFound()
|
|
}
|
|
|
|
const processedContent = processMdxForLLMs(
|
|
await page.data.getText("raw"),
|
|
activeStyle.name
|
|
)
|
|
|
|
return new NextResponse(processedContent, {
|
|
headers: {
|
|
"Content-Type": "text/markdown; charset=utf-8",
|
|
},
|
|
})
|
|
}
|
|
|
|
export function generateStaticParams() {
|
|
return source.generateParams()
|
|
}
|