-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontentlayer.config.ts
45 lines (41 loc) · 1.24 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
37
38
39
40
41
42
43
44
45
import { makeSource } from "contentlayer/source-files";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import remarkGfm from "remark-gfm";
import { rehypePrettyCodeOptions } from "./src/lib/contentlayer/rehype-pretty-code-options";
import { StyleCodeComponent } from "./src/lib/contentlayer/style-code-component";
import { Post } from "./src/lib/contentlayer/definitions/Post";
import { Other } from "./src/lib/contentlayer/definitions/Other";
import { Project } from ".//src/lib/contentlayer/definitions/Project";
export default makeSource({
contentDirPath: "src/content",
documentTypes: [Post, Other, Project],
mdx: {
esbuildOptions(options) {
options.target = "esnext";
return options;
},
remarkPlugins: [[remarkGfm]],
rehypePlugins: [
[
rehypeSlug,
{
prefix: "heading-",
},
],
[
rehypeAutolinkHeadings,
{
behavior: "wrap",
properties: {
className: "auto-linked-heading",
},
},
],
// @ts-ignore
[rehypePrettyCode, rehypePrettyCodeOptions],
[StyleCodeComponent],
],
},
});