snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
22
apps/v4/app/sitemap.ts
Normal file
22
apps/v4/app/sitemap.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { MetadataRoute } from "next"
|
||||
|
||||
import { registryCategories } from "@/lib/categories"
|
||||
import { siteConfig } from "@/lib/config"
|
||||
import { source } from "@/lib/source"
|
||||
|
||||
const chartTypes = ["area", "bar", "line", "pie", "radar", "radial", "tooltip"]
|
||||
|
||||
const staticRoutes = ["/", "/blocks", "/colors", "/create", "/sera", "/typeset"]
|
||||
|
||||
export default function sitemap(): MetadataRoute.Sitemap {
|
||||
const urls = [
|
||||
...staticRoutes,
|
||||
...source.getPages().map((page) => page.url),
|
||||
...registryCategories.map((category) => `/blocks/${category.slug}`),
|
||||
...chartTypes.map((type) => `/charts/${type}`),
|
||||
]
|
||||
|
||||
return [...new Set(urls)].map((path) => ({
|
||||
url: new URL(path, siteConfig.url).toString(),
|
||||
}))
|
||||
}
|
||||
Reference in New Issue
Block a user