-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.config.ts
93 lines (90 loc) · 2.55 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
import { defineCollection, z, type Collection } from "@nuxt/content";
import { asRobotsCollection } from "@nuxtjs/robots/content";
import { asSitemapCollection } from "@nuxtjs/sitemap/content";
const commonCollection = (collection: Collection<Zod.ZodRawShape>): Collection<Zod.ZodRawShape> => {
return defineCollection(asRobotsCollection(asSitemapCollection(collection)));
};
const commonSchema = {
title: z.string(),
date: z.string().datetime(),
tags: z.array(z.string()).optional(),
robots: z.boolean().default(true),
image: z.string().optional(),
};
export const collections = {
content: commonCollection({
type: "page",
source: "*.md",
schema: z.object({
robots: z.boolean().default(true),
image: z.string().optional(),
}),
}),
blog: commonCollection({
type: "page",
source: "./blog/**/*.md",
schema: z.object({
...commonSchema,
subtitle: z.string(),
location: z.string().default("San Francisco, CA"),
rawbody: z.string(),
}),
}),
projects: commonCollection({
type: "page",
source: "./projects/**/*.md",
schema: z.object({
...commonSchema,
subtitle: z.string().optional(),
role: z.string(),
client: z.string().optional(),
clientLink: z.string().optional(),
technologies: z.array(z.string()).optional(),
gallery: z.array(z.string()).optional(),
video: z.boolean().default(false),
skip: z.number().default(0),
audio: z.boolean().default(false),
contributions: z.array(z.enum(["engineering", "design", "management"])).optional(),
link: z.string().optional(),
linkText: z.string().optional(),
}),
}),
roles: commonCollection({
type: "page",
source: "./roles/**/*.md",
schema: z.object({
...commonSchema,
company: z.string(),
end: z.string().date().optional(),
context: z.array(z.enum(["business", "personal", "educational", "volunteer"])).optional(),
location: z.string(),
link: z.string().optional(),
}),
}),
honors: defineCollection({
type: "page",
source: "./honors/**/*.md",
schema: z.object({
...commonSchema,
role: z.string(),
company: z.string(),
}),
}),
awards: defineCollection({
type: "data",
source: "./awards/**/*.yaml",
schema: z.object({
...commonSchema,
company: z.string(),
project: z.string(),
link: z.string().optional(),
}),
}),
trips: commonCollection({
type: "page",
source: "./trips/**/*.md",
schema: z.object({
...commonSchema,
}),
}),
};