Skip to content

Commit

Permalink
modify sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
d-ivashchuk committed Apr 8, 2024
1 parent 3480919 commit 16dd7d0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { allPosts } from "contentlayer/generated";
import { type MetadataRoute } from "next";
import { env } from "~/env.mjs";

export default function sitemap(): MetadataRoute.Sitemap {
const posts = allPosts;
return [
{
url: env.NEXT_PUBLIC_DEPLOYMENT_URL,
lastModified: new Date(),
changeFrequency: "yearly",
priority: 1,
},
//extend sitemap with other static or dynamic routes
...posts.map((post) => ({
url: `${env.NEXT_PUBLIC_DEPLOYMENT_URL}/${post.slug}`,
lastModified: new Date(post.date),
priority: 0.7,
})),
];
}

0 comments on commit 16dd7d0

Please sign in to comment.