Skip to content

Commit b4ab665

Browse files
committed
refactor: update docs schema definition + export type
1 parent f123420 commit b4ab665

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

docs/src/content/config.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import { z, defineCollection } from 'astro:content';
22

3+
const docsSchema = z.object({
4+
title: z.string(),
5+
description: z.string(),
6+
category: z.string(),
7+
});
8+
9+
export type Docs = z.infer<typeof docsSchema>;
10+
311
const docsCollection = defineCollection({
412
type: 'content',
5-
schema: z.object({
6-
title: z.string(),
7-
description: z.string(),
8-
category: z.string(),
9-
}),
13+
schema: docsSchema,
1014
});
1115

1216
export const collections = {

0 commit comments

Comments
 (0)