Skip to content

Commit

Permalink
feat(seo): update sitemap generator with new routes
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfg7 committed Jul 17, 2023
1 parent feb091d commit 3a2d9f2
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ import { allPosts } from 'contentlayer/generated'
import { slug } from '@/shared/lib/slug'

export default function sitemap(): MetadataRoute.Sitemap {
const commonRoutes = ['', 'categories', 'feed', 'tag', 'portifolio'].map(
route => ({
url: `${config.webserver.host}/${route}`,
lastModified: new Date().toISOString()
})
)
const commonRoutes = [
'',
'blog',
'blog/categories',
'blog/tag',
'blog/feed',
'blog/author',
'archive/portifolio'
].map(route => ({
url: `${config.webserver.host}/${route}`,
lastModified: new Date().toISOString()
}))

const tags = getUniqueTagListFromPosts().map(tag => ({
url: `${config.webserver.host}/blog/tag/${slug(tag)}`,
Expand Down

0 comments on commit 3a2d9f2

Please sign in to comment.