Skip to content

Commit

Permalink
feat(mdx): add new rehype/remark plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfg7 committed Dec 2, 2022
1 parent dee2a74 commit 8da086d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions contentlayer.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import remarkGfm from 'remark-gfm'
import remarkMath from 'remark-math'
import rehypePrettyCode from 'rehype-pretty-code'
import rehypeSlug from 'rehype-slug'
import rehypeToc from 'rehype-toc'
import rehypeKatex from 'rehype-katex'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'

import { makeSource } from 'contentlayer/source-files'

Expand All @@ -10,7 +15,18 @@ export default makeSource({
contentDirPath: 'content',
documentTypes: [Post],
mdx: {
remarkPlugins: [[remarkGfm]],
rehypePlugins: [[rehypePrettyCode, rehypePrettyCodeOptions]]
remarkPlugins: [remarkGfm, remarkMath],
rehypePlugins: [
[rehypePrettyCode, rehypePrettyCodeOptions],
rehypeSlug,
rehypeToc,
rehypeKatex,
[
rehypeAutolinkHeadings,
{
behavior: 'wrap'
}
]
]
}
})

0 comments on commit 8da086d

Please sign in to comment.