-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathcontent.config.ts
109 lines (104 loc) · 2.41 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import { defineCollection, z } from '@nuxt/content'
const commonContentSchema = z.object({
title: z.string().nonempty(),
description: z.string().nonempty(),
date: z.string().nonempty(),
})
const commonArticleSchema = z.object({
title: z.string().nonempty(),
description: z.string().nonempty(),
date: z.string().nonempty(),
image: z.string().url(),
readingTime: z.string().nonempty(),
tags: z.array(z.string().nonempty()),
})
const commonProjectSchema = z.object({
name: z.string().nonempty(),
image: z.string().url(),
link: z.string().url(),
release: z.string().nonempty(),
date: z.string().nonempty(),
featured: z.boolean().optional(),
})
const commonFaqSchema = z.object({
title: z.string().nonempty(),
subtitle: z.string().nonempty(),
faqQuestions: z.array(
z.object({
title: z.string().nonempty(),
questions: z.array(
z.object({
label: z.string().nonempty(),
content: z.string().nonempty(),
}),
),
}),
),
})
export const collections = {
content_en: defineCollection({
type: 'page',
source: {
include: 'en/**/*.md',
prefix: '/',
},
schema: commonContentSchema,
}),
content_fr: defineCollection({
type: 'page',
source: {
include: 'fr/**/*.md',
prefix: '/',
},
schema: commonContentSchema,
}),
articles_en: defineCollection({
type: 'page',
source: {
include: 'en/articles/*.md',
prefix: '/articles',
},
schema: commonArticleSchema,
}),
articles_fr: defineCollection({
type: 'page',
source: {
include: 'fr/articles/*.md',
prefix: '/articles',
},
schema: commonArticleSchema,
}),
projects_en: defineCollection({
type: 'data',
source: 'en/projects/*.json',
schema: commonProjectSchema,
}),
projects_fr: defineCollection({
type: 'data',
source: 'fr/projects/*.json',
schema: commonProjectSchema,
}),
stack: defineCollection({
type: 'data',
source: 'stack.json',
schema: z.object({
items: z.array(
z.object({
name: z.string().nonempty(),
link: z.string().url(),
icon: z.string().nonempty(),
}),
),
}),
}),
faq_en: defineCollection({
type: 'data',
source: 'en/faq.json',
schema: commonFaqSchema,
}),
faq_fr: defineCollection({
type: 'data',
source: 'fr/faq.json',
schema: commonFaqSchema,
}),
}