-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.ts
85 lines (80 loc) · 1.75 KB
/
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
import { defineCollection, z } from 'astro:content'
let blog = defineCollection({
schema: z.object({
date: z
.string()
.or(z.date())
.transform(val => new Date(val)),
keywords: z.string().array().optional(),
description: z.string(),
title: z.string(),
}),
type: 'content',
})
let projects = defineCollection({
schema: z.object({
links: z.object({
website: z.ostring(),
github: z.ostring(),
vscode: z.ostring(),
npm: z.string(),
}),
badges: z
.object({
name: z.string(),
url: z.string(),
})
.array(),
keywords: z.string().array().optional(),
description: z.string(),
title: z.string(),
type: z.string(),
id: z.string(),
}),
type: 'content',
})
let travelMap = defineCollection({
schema: z.object({
originName: z.string(),
originLang: z.string(),
code: z.string(),
}),
type: 'data',
})
let anime = defineCollection({
schema: z.object({
genres: z
.union([
z.literal('psychological'),
z.literal('slice-of-life'),
z.literal('supernatural'),
z.literal('adventure'),
z.literal('thriller'),
z.literal('fantasy'),
z.literal('mystery'),
z.literal('romance'),
z.literal('comedy'),
z.literal('action'),
z.literal('sci-fi'),
z.literal('horror'),
z.literal('drama'),
z.literal('mecha'),
z.literal('music'),
z.literal('ecchi'),
])
.array(),
originName: z.string(),
duration: z.number(),
episodes: z.number(),
score: z.number(),
year: z.number(),
id: z.string(),
}),
type: 'data',
})
export let collections = {
'travel-map': travelMap,
projects,
anime,
blog,
}