-
-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathcontent.config.ts
More file actions
26 lines (24 loc) · 703 Bytes
/
content.config.ts
File metadata and controls
26 lines (24 loc) · 703 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
import { glob } from "astro/loaders";
import { z } from "astro/zod";
import { defineCollection } from "astro:content";
const blog = defineCollection({
loader: glob({ pattern: "**/index.mdx", base: "./content/posts" }),
schema: z.object({
title: z.string(),
description: z.string().optional().default(""),
date: z.coerce.date(),
tags: z
.array(
z.union([z.string(), z.number()]).transform((value) => String(value)),
)
.optional()
.default([]),
banner: z.string().optional(),
bluesky: z.url().optional(),
slug: z.string().optional(),
searchIndex: z.boolean().optional().default(true),
}),
});
export const collections = {
blog,
};