feat: support toc

This commit is contained in:
DIYgod
2022-10-03 19:09:57 +01:00
parent 801d9e94c4
commit 1258a97714
+5
View File
@@ -24,6 +24,7 @@ import { remarkYoutube } from "./remark-youtube"
import sanitizeScheme from "./sanitize-schema"
import rehypeSlug from "rehype-slug"
import rehypeAutolinkHeadings from "rehype-autolink-headings"
import remarkToc from "remark-toc"
export type MarkdownEnv = {
excerpt: string
@@ -69,6 +70,10 @@ export const renderPageContent = (
console.log(e)
}
})
.use(remarkToc, {
tight: true,
ordered: true,
})
.use(remarkGfm, {})
.use(remarkExcerpt, { env })
.use(remarkCallout)