Skip to content

Commit

Permalink
dedupe package-lock and fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ashharrison90 committed Jun 14, 2024
1 parent 0fa7352 commit 07d274b
Show file tree
Hide file tree
Showing 2 changed files with 1,388 additions and 1,229 deletions.
6 changes: 2 additions & 4 deletions lib/postsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ export interface PostMetadata {
}

export async function getPostMetadata(slug: string) {
const realSlug = slug.replace(/\.mdx$/, '')
const filePath = `../pages/posts/${realSlug}.mdx`
const { metadata } = await import(filePath)
const { metadata } = await import(`../pages/posts/${slug}`)

return {
...metadata,
slug: realSlug,
slug: slug.replace(/\.mdx$/, ''),
}
}

Expand Down
Loading

0 comments on commit 07d274b

Please sign in to comment.