-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontentlayer.config.ts
46 lines (41 loc) · 1.01 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
46
// contentlayer.config.ts
import { makeSource } from 'contentlayer2/source-files'
import rehypeSlug from 'rehype-slug'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import remarkGfm from 'remark-gfm'
import { Article } from './schema/contentlayer/article'
import { Note } from './schema/contentlayer/note'
import { Page } from './schema/contentlayer/page'
import { Post } from './schema/contentlayer/post'
const contentLayerConfig = makeSource({
contentDirPath: 'content',
documentTypes: [Article, Note, Page, Post],
contentDirExclude: [
/* drafts */
'pages/_drafts',
'notes/_drafts',
'articles/_drafts',
'posts/_drafts',
/* MDX snippets to be used manually via native Nextjs components */
'snippets',
/* managed by keystatic */
'singletons',
'books',
'tools',
],
mdx: {
rehypePlugins: [
rehypeSlug,
[
rehypeAutolinkHeadings,
{
properties: {
className: ['anchor'],
},
},
],
],
remarkPlugins: [remarkGfm],
},
})
export default contentLayerConfig