Skip to content

Commit

Permalink
Create sitemap.ts
Browse files Browse the repository at this point in the history
Signed-off-by: gitworkflows <118260833+gitworkflows@users.noreply.github.com>
  • Loading branch information
gitworkflows authored Apr 11, 2024
1 parent a50a41f commit 5249686
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions solutions/blog/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -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]
}

1 comment on commit 5249686

@vercel
Copy link

@vercel vercel bot commented on 5249686 Apr 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

hand-pickr – ./

hand-pickr-git-main-devsec.vercel.app
hand-pickr.vercel.app
hand-pickr-devsec.vercel.app

Please sign in to comment.