UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.
fix(www): use siteConfig.url in sitemap and restore static generation (#1015)
Masatoshi Ogiwaracdb348cb4c72
diff --git a/apps/www/app/sitemap.ts b/apps/www/app/sitemap.tsindex caee31e7..9e1d284e 100644--- a/apps/www/app/sitemap.ts+++ b/apps/www/app/sitemap.ts@@ -1,26 +1,27 @@import type { MetadataRoute } from "next"-import { headers } from "next/headers"+import { siteConfig } from "@/config/site"import { blogSource, source } from "@/lib/source"+export const revalidate = false+export const dynamic = "force-static"+export default async function sitemap(): Promise<MetadataRoute.Sitemap> {- const headersList = await headers()- const domain = headersList.get("host") as string- const protocol = "https"+ const domain = siteConfig.urlconst allDocs = source.getPages()const allBlogs = blogSource.getPages()return [{- url: `${protocol}://${domain}`,+ url: domain,lastModified: new Date(),},...allDocs.map((post) => ({- url: `${protocol}://${domain}${post.url}`,+ url: `${domain}${post.url}`,lastModified: post.data.date,})),...allBlogs.map((post) => ({- url: `${protocol}://${domain}${post.url}`,+ url: `${domain}${post.url}`,lastModified: post.data.publishedOn,})),]