-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfig.ts
More file actions
55 lines (50 loc) · 1.23 KB
/
config.ts
File metadata and controls
55 lines (50 loc) · 1.23 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
49
50
51
52
53
54
55
import { defineCollection, z } from 'astro:content';
import { docsSchema } from '@astrojs/starlight/schema';
const blogCollection = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
draft: z.boolean(),
publishDate: z.union([z.number(), z.string(), z.date()]).pipe(z.coerce.date()),
authors: z.array(
z.object({
name: z.string(),
url: z.string().url(),
})
),
}),
});
const docsCollection = defineCollection({
type: 'content',
// biome-ignore lint/suspicious/noExplicitAny: https://github.com/withastro/starlight/issues/1612
schema: docsSchema() as any,
});
const projectsCollection = defineCollection({
type: 'content',
schema: z.object({
name: z.string(),
kind: z.enum(['integration', 'component', 'misc', 'website', 'event']),
links: z
.object({
website: z.string().url(),
github: z.string().url(),
})
.partial()
.default({}),
}),
});
const friendsCollection = defineCollection({
type: 'data',
schema: z.object({
name: z.string(),
logo: z.string().url(),
url: z.string().url(),
slogan: z.string().optional(),
}),
});
export const collections = {
blog: blogCollection,
docs: docsCollection,
projects: projectsCollection,
friends: friendsCollection,
};