-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.config.ts
64 lines (57 loc) · 1.31 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
import { defineCollection, z } from '@nuxt/content'
// import { asOgImageCollection } from 'nuxt-og-image/content'
export default {
collections: {
article: defineCollection({
type: 'page',
source: 'articles/**/*.md',
schema: z.object({
title: z.string(),
description: z.string(),
ogImage: z.string().optional(),
slug: z.string(),
date: z.date(),
tags: z.array(z.string()),
published: z.boolean(),
archived: z.boolean().optional(),
updated_at: z.date().optional(),
hide_toc: z.boolean().optional(),
})
}),
tag: defineCollection({
type: 'data',
source: 'tags/**.json',
schema: z.object({
title: z.string(),
description: z.string(),
slug: z.string(),
})
}),
page: defineCollection({
type: 'page',
source: '**/*.md',
schema: z.object({
title: z.string(),
description: z.string(),
slug: z.string(),
date: z.date().optional(),
updated_at: z.date().optional(),
}),
}),
bag: defineCollection({
type: 'data',
source: 'bag/**.json',
schema: z.object({
name: z.string(),
description: z.string(),
order: z.number().optional(),
items: z.array(z.object({
name: z.string(),
description: z.string(),
url: z.string().optional(),
thumbnail: z.string().optional(),
}))
})
})
}
}