Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
sistematico committed Dec 13, 2024
1 parent 7635336 commit c8ed204
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion app/posts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@ function getMDXData(dir: string) {
})
}

const BLOG_POSTS = getMDXData(path.join(process.cwd(), 'app', 'posts', 'content'))

export function getBlogPosts() {
return getMDXData(path.join(process.cwd(), 'app', 'posts', 'content'))
return BLOG_POSTS
}

// export function getBlogPosts() {
// return getMDXData(path.join(process.cwd(), 'app', 'posts', 'content'))
// }

export function formatDate(date: string, includeRelative = false) {
let currentDate = new Date()
if (!date.includes('T')) {
Expand Down
4 changes: 2 additions & 2 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ export const baseUrl = 'https://paxa.dev'

export default async function sitemap() {
let blogs = getBlogPosts().map((post) => ({
url: `${baseUrl}/blog/${post.slug}`,
url: `${baseUrl}/posts/${post.slug}`,
lastModified: post.metadata.publishedAt,
}))

let routes = ['', '/blog'].map((route) => ({
let routes = ['', '/posts'].map((route) => ({
url: `${baseUrl}${route}`,
lastModified: new Date().toISOString().split('T')[0],
}))
Expand Down

0 comments on commit c8ed204

Please sign in to comment.