-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.config.ts
68 lines (67 loc) · 1.67 KB
/
content.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
import {
defineCollection,
defineContentConfig,
z,
} from '@nuxt/content'
export default defineContentConfig({
collections: {
copy: defineCollection({
type: 'page',
source: 'copy/*.md',
schema: z.object({
path: z.string(),
title: z.string(),
description: z.string(),
seo: z.intersection(
z.object({
title: z.string().optional(),
description: z.string().optional(),
meta: z.array(z.record(z.string(), z.any())).optional(),
link: z.array(z.record(z.string(), z.any())).optional(),
}),
z.record(z.string(), z.any()),
).optional().default({}),
body: z.object({
type: z.string(),
children: z.any(),
toc: z.any(),
}),
navigation: z.union([
z.boolean(),
z.object({
title: z.string(),
description: z.string(),
icon: z.string(),
}),
]).default(true),
}),
}),
blog: defineCollection({
type: 'page',
source: 'blog/*.md',
schema: z.object({
slug: z.string(),
title: z.string(),
description: z.string(),
createdAt: z.string(),
published: z.boolean(),
tags: z.array(z.object({
name: z.string(),
value: z.string(),
})),
order: z.number(),
}),
}),
projects: defineCollection({
type: 'page',
source: 'projects/*.md',
schema: z.object({
headline: z.string(),
subline: z.string(),
description: z.string(),
url: z.string(),
order: z.number(),
}),
}),
},
})