feat: toc for blog post

This commit is contained in:
Timothy Lin
2021-08-06 22:13:30 +08:00
parent 304318376c
commit afbc2d9c66
7 changed files with 52 additions and 1 deletions

View File

@ -39,13 +39,14 @@ export async function getStaticProps({ params }) {
}
export default function Blog({ post, authorDetails, prev, next }) {
const { mdxSource, frontMatter } = post
const { mdxSource, toc, frontMatter } = post
return (
<>
{frontMatter.draft !== true ? (
<MDXLayoutRenderer
layout={frontMatter.layout || DEFAULT_LAYOUT}
toc={toc}
mdxSource={mdxSource}
frontMatter={frontMatter}
authorDetails={authorDetails}