-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcontent.config.ts
55 lines (53 loc) · 1.5 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
import { defineCollection, defineContentConfig, z } from '@nuxt/content'
export default defineContentConfig({
collections: {
content: defineCollection({
type: 'page',
source: '**/*.md',
schema: z.object({
// corresponding schema applied
// https://content.nuxt.com/docs/collections/types#schema-overrides
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),
// Content schema
cover: z.string(),
alt: z.string(),
ogImage: z.string(),
tags: z.array(z.string()),
category: z.string(),
publishedAt: z.date(),
editedAt: z.date(),
published: z.boolean(),
wordCount: z.number(),
}),
}),
},
})