Skip to content

Commit

Permalink
Added sitemap.
Browse files Browse the repository at this point in the history
  • Loading branch information
vegetableman committed May 8, 2024
1 parent d49892d commit 5ad1660
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// https://searchengineland.com/microsoft-bing-to-rely-more-on-lastmod-date-in-xml-sitemap-files-for-crawling-392491


import { getSortedPostsData } from '@/lib/posts'
import { MetadataRoute } from 'next';


const URL = "https://www.tetmon.com";


export default function sitemap(): MetadataRoute.Sitemap {
const posts = getSortedPostsData();
return [
{
url: URL,
lastModified: new Date(),
changeFrequency: 'yearly' as const,
priority: 1,
},
{
url: `${URL}/about`,
lastModified: new Date(),
changeFrequency: 'monthly' as const,
priority: 0.8,
},
{
url: `${URL}/blog`,
lastModified: new Date(),
changeFrequency: 'weekly' as const,
priority: 1,
},
...posts.map((post) => ({
url: `${URL}/blog/${post.id}`,
lastModified: new Date(post.date),
changeFrequency: 'weekly' as const,
priority: 0.9,
})),
]
}

0 comments on commit 5ad1660

Please sign in to comment.