-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontentlayer.config.ts
42 lines (39 loc) · 1.28 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
import { defineDocumentType, makeSource } from 'contentlayer/source-files';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import remarkGfm from 'remark-gfm';
export const Blog = defineDocumentType(() => ({
name: 'Blog',
filePathPattern: 'blogs/*.mdx',
contentType: 'mdx',
fields: {
title: { type: 'string', required: true },
date: { type: 'date', required: true },
slug: { type: 'string', required: true },
featured: { type: 'boolean', default: false },
thumbnail: { type: 'string' },
},
}));
export const Work = defineDocumentType(() => ({
name: 'Work',
filePathPattern: 'works/*.mdx',
contentType: 'mdx',
fields: {
title: { type: 'string', required: true },
position: { type: 'string', required: true },
shortDescription: { type: 'string', required: true },
featured: { type: 'boolean', default: false },
slug: { type: 'string', required: true },
startDate: { type: 'date', required: true },
endDate: { type: 'date', required: false },
externalLink: { type: 'string' },
thumbnail: { type: 'string', required: true },
},
}));
export default makeSource({
contentDirPath: 'src/contents',
documentTypes: [Blog, Work],
mdx: {
remarkPlugins: [remarkGfm],
rehypePlugins: [rehypeAutolinkHeadings],
},
});