1 parent 67b9f10 commit 56a4a42Copy full SHA for 56a4a42
1 file changed
workspaces/website/src/content.config.ts
@@ -0,0 +1,26 @@
1
+import { defineCollection, z } from 'astro:content';
2
+import { glob } from 'astro/loaders';
3
+
4
+const blahg = defineCollection({
5
+ loader: glob({ pattern: '**/[!_]*.md', base: './src/content/blahg' }),
6
+ schema: z.object({
7
+ title: z.string(),
8
+ description: z.string(),
9
+ pageTitle: z.string().optional(),
10
+ pageDescription: z.string().optional(),
11
+ pubDate: z
12
+ .string()
13
+ .or(z.date())
14
+ .transform((val) => new Date(val)),
15
+ updatedDate: z
16
17
+ .optional()
18
+ .transform((str) => (str ? new Date(str) : undefined)),
19
+ heroImage: z.string().optional(),
20
+ heroImageDesc: z.string().optional(),
21
+ series: z.string().optional(),
22
+ schemaType: z.string().default('BlogPosting'),
23
+ }),
24
+});
25
26
+export const collections = { blahg };
0 commit comments