-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathcontent.config.ts
More file actions
48 lines (46 loc) · 1.11 KB
/
content.config.ts
File metadata and controls
48 lines (46 loc) · 1.11 KB
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
import { defineCollection, defineContentConfig, z } from '@nuxt/content'
const schema = z.object({
title: z.string(),
desc: z.string().optional(),
category: z.enum(['layout', 'form', 'element', 'navigation', 'data', 'overlay']).optional(),
navigation: z.object({
title: z.string().optional()
}),
banner: z.string().optional(),
avatar: z.object({
src: z.string(),
alt: z.string()
}).optional(),
links: z.array(z.object({
label: z.string(),
icon: z.string(),
avatar: z.object({
src: z.string(),
alt: z.string()
}).optional(),
to: z.string(),
target: z.string().optional()
})).optional()
})
export default defineContentConfig({
collections: {
docs: defineCollection({
source: {
include: '**',
exclude: ['**/*.json']
},
type: 'page',
schema
}),
openapi: defineCollection({
type: 'data',
source: 'api.json',
schema: z.object({}).passthrough()
}),
dashboardApi: defineCollection({
type: 'data',
source: '**/api_docs/api.json',
schema: z.object({}).passthrough()
})
}
})