mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-05-29 22:37:44 +02:00
refactor: minor changes
This commit is contained in:
@ -37,8 +37,8 @@ export const getPosts = async (): Promise<PostMetadata[]> => {
|
||||
const posts = await fs.promises.readdir(POSTS_PATH)
|
||||
const postsWithTime = await Promise.all(
|
||||
posts.map(async (postFilename) => {
|
||||
const [slug] = postFilename.split('.')
|
||||
const blogPostPath = path.join(POSTS_PATH, `${slug}.mdx`)
|
||||
const [slug, extension] = postFilename.split('.')
|
||||
const blogPostPath = path.join(POSTS_PATH, `${slug}.${extension}`)
|
||||
const blogPostContent = await fs.promises.readFile(blogPostPath, {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
|
Reference in New Issue
Block a user