dependabot/npm_and_yarn/eslint-9.39.1
dependabot/npm_and_yarn/eslint-9.39.1
dependabot/npm_and_yarn/eslint-plugin-astro-1.5.0
dependabot/npm_and_yarn/eslint/js-9.39.1
dependabot/npm_and_yarn/katex-0.16.25
dependabot/npm_and_yarn/sharp-0.34.5
dependabot/npm_and_yarn/tailwindcss/vite-4.1.17
dependabot/npm_and_yarn/tsx-4.20.6
dependabot/npm_and_yarn/typescript-eslint-8.46.4
dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-8.36.0
dependabot/npm_and_yarn/typescript-eslint/parser-8.46.4
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 } |