This commit is contained in:
louiscklaw
2025-02-01 20:19:28 +08:00
commit 8013ac2455
274 changed files with 26971 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import { getBlogPosts } from 'app/blog/utils'
export const baseUrl = 'https://portfolio-blog-starter.vercel.app'
export default async function sitemap() {
let blogs = getBlogPosts().map((post) => ({
url: `${baseUrl}/blog/${post.slug}`,
lastModified: post.metadata.publishedAt,
}))
let routes = ['', '/blog'].map((route) => ({
url: `${baseUrl}${route}`,
lastModified: new Date().toISOString().split('T')[0],
}))
return [...routes, ...blogs]
}