-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcontent-collections.ts
92 lines (85 loc) · 1.99 KB
/
content-collections.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
import { defineCollection, defineConfig } from '@content-collections/core';
import {
createDocSchema,
createMetaSchema,
transformMDX,
} from '@fumadocs/content-collections/configuration';
// 블로그 컬렉션
const blog = defineCollection({
name: 'blog',
directory: 'content/blog',
include: '**/*.mdx',
schema: (z) => {
return {
...createDocSchema(z),
authors: z.array(z.string()).optional(),
createdAt: z.string().optional(),
updatedAt: z.string().optional(),
tags: z.array(z.string()).optional(),
}
},
transform: transformMDX,
});
const blogMeta = defineCollection({
name: 'blogMeta',
directory: 'content/blog',
include: '**/meta.json',
parser: 'json',
schema: createMetaSchema,
});
// 가이드 컬렉션
const docs = defineCollection({
name: 'docs',
directory: 'content/docs',
include: '**/*.mdx',
schema: (z) => {
return {
...createDocSchema(z),
authors: z.array(z.string()).optional(),
createdAt: z.string().optional(),
updatedAt: z.string().optional(),
tags: z.array(z.string()).optional(),
}
},
transform: transformMDX,
});
const docsMeta = defineCollection({
name: 'docsMeta',
directory: 'content/docs',
include: '**/meta.json',
parser: 'json',
schema: createMetaSchema,
});
// 큐레이션 컬렉션
const curation = defineCollection({
name: 'curation',
directory: 'content/curation',
include: '**/*.mdx',
schema: (z) => {
return {
...createDocSchema(z),
authors: z.array(z.string()).optional(),
createdAt: z.string().optional(),
updatedAt: z.string().optional(),
tags: z.array(z.string()).optional(),
}
},
transform: transformMDX,
});
const curationMeta = defineCollection({
name: 'curationMeta',
directory: 'content/curation',
include: '**/meta.json',
parser: 'json',
schema: createMetaSchema,
});
export default defineConfig({
collections: [
blog,
blogMeta,
docs,
docsMeta,
curation,
curationMeta
],
});