-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.config.ts
53 lines (52 loc) · 1.46 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
import { defineContentConfig, defineCollection, z } from '@nuxt/content'
export default defineContentConfig({
collections: {
content: defineCollection({
type: 'page',
source: '**/*.md',
schema: z.object({
// layout: z.enum(['default', 'blog']).default('default'),
title: z.string(),
description: z.string(),
// head: z.object({
// meta: z.array(z.object({
// name: z.string(),
// content: z.string(),
// })).optional(),
// htmlAttrs: z.object({
// lang: z.string(),
// }).optional(),
// title: z.string(),
// bodyAttrs: z.object({
// class: z.string(),
// }).optional(),
// }),
}),
}),
blog: defineCollection({
type: 'page',
source: 'blog/*.md',
schema: z.object({
title: z.string(),
description: z.string(),
authors: z.array(z.object({
name: z.string(),
picture: z.string(),
twitter: z.string(),
})),
tags: z.array(z.string()),
date: z.string(),
updatedAt: z.string().optional(),
image: z.string().default('/images/og/ogImage.jpeg'),
rawbody: z.string(),
toc: z.object({
items: z.array(z.object({
id: z.string(),
text: z.string(),
depth: z.number(),
})).optional(),
}).optional(),
}),
}),
},
})