feat : add sitemao and some SEO
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import type { MetadataRoute } from "next";
|
||||
import { connection } from "next/server";
|
||||
|
||||
import { getCachedPublicGuideCards } from "@/lib/cache/public";
|
||||
import { siteUrl } from "@/lib/site-url";
|
||||
|
||||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
await connection();
|
||||
const guides = await getCachedPublicGuideCards();
|
||||
|
||||
return [
|
||||
{ url: siteUrl },
|
||||
...guides.map((guide) => ({
|
||||
url: `${siteUrl}/${encodeURIComponent(guide.slug)}`,
|
||||
})),
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user