-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontentlayer.config.ts
36 lines (34 loc) · 1.1 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
import { defineDocumentType, makeSource } from 'contentlayer/source-files'
export const Episodes = defineDocumentType(() => ({
name: 'Podcast',
filePathPattern: `episodes/*.md`,
fields: {
type: { type: 'string', required: true },
guid: { type: 'string', required: true },
episodeNumber: { type: 'number', required: true },
season: { type: 'number', required: true },
title: { type: 'string', required: true },
slug: { type: 'string', required: true },
description: { type: 'string', required: true },
publicationDate: { type: 'date', required: true },
url: { type: 'string', required: true },
status: {
type: 'enum',
options: ['published', 'draft', 'archived'],
default: 'draft',
required: true,
},
author: { type: 'string', required: true },
episodeType: {
type: 'enum',
options: ['full', 'trailer', 'bonus'],
required: true,
},
duration: { type: 'number', required: true },
size: { type: 'number', required: true },
},
}))
export default makeSource({
contentDirPath: 'content',
documentTypes: [Episodes],
})