Skip to content

Commit

Permalink
fix: omit debug routes from sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
mwskwong authored Feb 7, 2025
1 parent ad0b9d1 commit 8d8a5c2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ const sitemap = async () => {
const blogPosts = await getBlogPosts();

return [
...Object.values(routes).map(({ pathname }) => ({
url: siteUrl + pathname,
lastModified: new Date(),
})),
...Object.values(routes)
.filter(({ pathname }) => !pathname.includes("/_"))
.map(({ pathname }) => ({
url: siteUrl + pathname,
lastModified: new Date(),
})),
...blogPosts.map(({ slug, updatedAt }) => ({
url: `${siteUrl}${routes.blog.pathname}/${slug}`,
lastModified: updatedAt,
Expand Down

0 comments on commit 8d8a5c2

Please sign in to comment.