fix: slug links for nested posts
This commit is contained in:
@ -42,8 +42,8 @@ export function dateSortDesc(a, b) {
|
||||
}
|
||||
|
||||
export async function getFileBySlug(type, slug) {
|
||||
const mdxPath = path.join(root, 'data', type, `${slug.join('/')}.mdx`)
|
||||
const mdPath = path.join(root, 'data', type, `${slug.join('/')}.md`)
|
||||
const mdxPath = path.join(root, 'data', type, `${slug}.mdx`)
|
||||
const mdPath = path.join(root, 'data', type, `${slug}.md`)
|
||||
const source = fs.existsSync(mdxPath)
|
||||
? fs.readFileSync(mdxPath, 'utf8')
|
||||
: fs.readFileSync(mdPath, 'utf8')
|
||||
|
Reference in New Issue
Block a user