mirror of
https://github.com/Dokploy/website.git
synced 2026-06-29 02:55:23 +02:00
feat: enhance sitemap generation to include blog posts and their metadata
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { getPosts } from "@/lib/ghost";
|
||||
import type { MetadataRoute } from "next";
|
||||
|
||||
export default function sitemap(): MetadataRoute.Sitemap {
|
||||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
const posts = await getPosts();
|
||||
return [
|
||||
{
|
||||
url: "https://dokploy.com",
|
||||
@@ -8,5 +10,17 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
||||
changeFrequency: "monthly",
|
||||
priority: 1,
|
||||
},
|
||||
{
|
||||
url: "https://dokploy.com/blog",
|
||||
lastModified: new Date(),
|
||||
changeFrequency: "monthly",
|
||||
priority: 0.8,
|
||||
},
|
||||
...posts.map((post) => ({
|
||||
url: `https://dokploy.com/blog/${post.slug}`,
|
||||
lastModified: new Date(post.published_at),
|
||||
changeFrequency: "monthly" as const,
|
||||
priority: 0.8,
|
||||
})),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user