fix: slug links for nested posts

This commit is contained in:
Timothy Lin
2021-05-26 19:20:24 +08:00
parent 3c3cb9cbeb
commit 52ff63576b
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ export async function getStaticProps({ params }) {
const postIndex = allPosts.findIndex((post) => formatSlug(post.slug) === params.slug.join('/'))
const prev = allPosts[postIndex + 1] || null
const next = allPosts[postIndex - 1] || null
const post = await getFileBySlug('blog', params.slug)
const post = await getFileBySlug('blog', params.slug.join('/'))
// rss
const rss = generateRss(allPosts)