-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontent.config.ts
51 lines (48 loc) · 1.02 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
import { glob } from "astro/loaders";
import { defineCollection, z } from "astro:content";
const blog = defineCollection({
loader: glob({
pattern: "**/*.{md,mdx}",
base: "./content/blog",
}),
schema: {
title: z.string(),
subtitle: z.string().optional(),
date: z.string(),
published: z.boolean().optional(),
description: z.string().optional(),
image: z.string().optional(),
taxonomy: z
.array(
z.object({
category: z.string(),
tags: z.array(z.string()),
}),
)
.optional(),
hreflang: z.array(
z
.object({
lang: z.string(),
url: z.string(),
})
.optional(),
),
},
});
const pages = defineCollection({
loader: glob({
pattern: "**/*.{md,mdx}",
base: "./content/pages",
}),
schema: {
title: z.string(),
subtitle: z.string().optional(),
date: z.string().optional(),
description: z.string().optional(),
},
});
export const collections = {
blog,
pages,
};