-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontentlayer.config.ts
39 lines (38 loc) · 1.03 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
import { makeSource } from 'contentlayer/source-files';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeSlug from 'rehype-slug';
import rehypePrettyCode from 'rehype-pretty-code';
import remarkGfm from 'remark-gfm';
import {
HEADING_LINK_ANCHOR,
rehypePrettyCodeClasses,
rehypePrettyCodeOptions,
} from './src/lib/rehypePrettyCode';
import { Post } from './src/types/Post';
import { Page } from './src/types/Page';
import { Micropost } from './src/types/Micropost';
export default makeSource({
contentDirPath: 'content',
documentTypes: [Post, Page, Micropost],
mdx: {
esbuildOptions(options) {
options.target = 'esnext';
return options;
},
remarkPlugins: [[remarkGfm]],
rehypePlugins: [
[rehypePrettyCode, rehypePrettyCodeOptions],
[rehypePrettyCodeClasses],
[rehypeSlug],
[
rehypeAutolinkHeadings,
{
behavior: 'wrap',
properties: {
className: [HEADING_LINK_ANCHOR],
},
},
],
],
},
});