-
Notifications
You must be signed in to change notification settings - Fork 3
/
contentlayer.config.ts
102 lines (96 loc) · 2.3 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import { defineDocumentType, makeSource } from 'contentlayer/source-files'
const changelog = defineDocumentType(() => ({
name: 'Changelog',
contentType: 'mdx',
filePathPattern: 'changelog/*.mdx',
fields: {
publishDate: {
type: 'date',
description: 'The publish date for the changelog',
required: true,
},
published: {
type: 'boolean',
description: 'Whether the changelog is published',
required: true,
},
},
}))
// const contributors = defineDocumentType(() => ({
// name: 'Contributors',
// contentType: 'mdx',
// filePathPattern: 'contributors/*.mdx',
// fields: {},
// }))
// const coreTeam = defineDocumentType(() => ({
// name: 'Core Team',
// contentType: 'mdx',
// filePathPattern: 'core-team/*.mdx',
// fields: {},
// }))
const events = defineDocumentType(() => ({
name: 'Events',
contentType: 'mdx',
filePathPattern: 'events/*.mdx',
fields: {
title: {
type: 'string',
description: 'The title of the event',
required: true,
},
date: {
type: 'date',
description: 'The date of the event',
required: true,
},
description: {
type: 'string',
description: 'The description of the event',
required: true,
},
rsvp: {
type: 'string',
description: 'The RSVP link for the event',
required: true,
},
published: {
type: 'boolean',
description: 'Whether the event is published',
required: true,
},
},
}))
const roadmap = defineDocumentType(() => ({
name: 'Roadmap',
contentType: 'mdx',
filePathPattern: 'roadmap/*.mdx',
fields: {
title: {
type: 'string',
description: 'The title of the feature',
required: true,
},
description: {
type: 'string',
description: 'The description of the feature',
required: true,
},
status: {
type: 'enum',
options: ['planned', 'later', 'done', 'soon'],
description: 'The status of the feature',
required: true,
},
relatedPR: {
type: 'string',
options: 'string',
description: 'The related PR for the feature',
required: false,
},
},
}))
export default makeSource({
documentTypes: [changelog, events, roadmap],
contentDirPath: './content',
disableImportAliasWarning: true,
})