-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontentlayer.config.ts
36 lines (35 loc) · 1.02 KB
/
contentlayer.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { makeSource } from "contentlayer/source-files";
import flattenImageParagraphs from "mdast-flatten-image-paragraphs";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import remarkGfm from "remark-gfm";
import remarkNormalizeHeadings from "./lib/mdx/remark-normalize-headings";
import BlogPost from "./schema/contentlayer/blog-post";
export default makeSource({
contentDirPath: "content",
documentTypes: [BlogPost],
mdx: {
remarkPlugins: [remarkGfm, flattenImageParagraphs, remarkNormalizeHeadings],
rehypePlugins: [
rehypeSlug,
[
rehypeAutolinkHeadings,
{
behavior: "append",
properties: {
className: ["anchor-link"],
ariaHidden: true,
},
},
],
[
rehypePrettyCode,
{
theme: { dark: "github-dark", light: "github-light" },
keepBackground: false,
},
],
],
},
});