mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-26 06:05:56 +00:00
The <ComponentsList /> tag on /docs/components was emitted as-is by the Copy Page button and the /llm/[slug] markdown endpoint because getComponentsList() walked components.children for pages directly. After #9304 restructured the folder into components/radix/ and components/base/ subfolders, the filter always returned [] and the tag was replaced with an empty string (or, in the copy-page case, never replaced at all). - Reuse getPagesFromFolder() from lib/page-tree so the walker stays in sync with the on-screen ComponentsList React component. - Match the existing llms.txt format: flat absolute URLs (the /docs/components/:name -> /docs/components/radix/:name redirect in next.config.mjs is the canonical form) plus the frontmatter description pulled via source.getPage() on each page. - Export replaceComponentsList() and call it from docs/[[...slug]]/page.tsx so the Copy Page button goes through the same replacement path as processMdxForLLMs.