forked from
quillmatiq.com/augment
Fork of Chiri for Astro for my blog
1import { glob } from 'astro/loaders'
2import { defineCollection, z } from 'astro:content'
3
4const posts = defineCollection({
5 // Load Markdown and MDX files in the `src/content/posts/` directory.
6 loader: glob({ base: './src/content/posts', pattern: '**/*.{md,mdx}' }),
7 // Type-check frontmatter using a schema
8 schema: () =>
9 z.object({
10 title: z.string(),
11 // Transform string to Date object
12 pubDate: z.coerce.date(),
13 image: z.string().optional()
14 })
15})
16
17const about = defineCollection({
18 // Load Markdown files in the `src/content/about/` directory.
19 loader: glob({ base: './src/content/about', pattern: '**/*.md' }),
20 // Type-check frontmatter using a schema
21 schema: z.object({})
22})
23
24export const collections = { posts, about }