add remark and rehype plugins

This commit is contained in:
khalilcodes 2022-04-07 03:04:49 +03:00
parent 5e75ffc8bb
commit c9c4c00c2b
1 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,9 @@
import { defineDocumentType, makeSource } from 'contentlayer/source-files'
// import readingTime from 'reading-time'
import remarkGfm from 'remark-gfm';
import rehypeSlug from 'rehype-slug'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import wikiLinkPlugin from "remark-wiki-link-plus"
const OtherPage = defineDocumentType(() => ({
name: 'OtherPage',
@ -18,6 +21,10 @@ export default makeSource({
contentDirPath: 'content',
documentTypes: [OtherPage],
mdx: {
remarkPlugins: [remarkGfm],
remarkPlugins: [
remarkGfm,
[wikiLinkPlugin, { markdownFolder: 'content' }]
],
rehypePlugins: [rehypeSlug, rehypeAutolinkHeadings]
}
})