Fork of Chiri for Astro for my blog
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at bcd31bfa38a6de9fbb609d7d564d453959a9a365 24 lines 768 B view raw
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 }