-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathcontent.config.ts
More file actions
31 lines (30 loc) · 919 Bytes
/
content.config.ts
File metadata and controls
31 lines (30 loc) · 919 Bytes
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
import { defineCollection, z } from "astro:content";
import { docsLoader } from "@astrojs/starlight/loaders";
import { docsSchema } from "@astrojs/starlight/schema";
import { autoSidebarLoader } from "starlight-auto-sidebar/loader";
import { autoSidebarSchema } from "starlight-auto-sidebar/schema";
export const collections = {
docs: defineCollection({
loader: docsLoader(),
schema: docsSchema({
extend: z.object({
cppdoc: z
.object({
keys: z.array(z.string()).optional(),
revision: z
.object({
lang: z.string().optional(),
since: z.string().optional(),
until: z.string().optional(),
})
.optional(),
})
.optional(),
}),
}),
}),
autoSidebar: defineCollection({
loader: autoSidebarLoader(),
schema: autoSidebarSchema(),
}),
};