dependabot/npm_and_yarn/astrojs/mdx-7.0.8
dependabot/npm_and_yarn/astro-7.4.0
dependabot/npm_and_yarn/astrojs/mdx-7.0.8
dependabot/npm_and_yarn/astrojs/sitemap-3.7.4
dependabot/npm_and_yarn/katex-0.19.0
dependabot/npm_and_yarn/prettier-3.9.10
dependabot/npm_and_yarn/sharp-0.35.5
dependabot/npm_and_yarn/tsx-4.23.15
dependabot/npm_and_yarn/typescript-eslint-8.71.2
dependabot/npm_and_yarn/typescript-eslint/parser-8.71.2
development
main
| 1 | import { glob } from 'astro/loaders' |
| 2 | import { defineCollection, z } from 'astro:content' |
| 3 | |
| 4 | const 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 | |
| 17 | const 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 | |
| 24 | export const collections = { posts, about } |