update,
This commit is contained in:
17
aastock/1/blog/app/sitemap.ts
Normal file
17
aastock/1/blog/app/sitemap.ts
Normal 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]
|
||||
}
|
Reference in New Issue
Block a user