Something went wrong. Try again.
version 2 of my website
Something went wrong. Try again.
522 B · 19 lines
TypeScript
at commit f7462afe
1234567891011121314151617181920import { z } from "astro/zod";import { defineCollection } from "astro:content";
import { glob } from "astro/loaders";
const blog = defineCollection({ loader: glob({ base: "./blog", pattern: "**/*.{md,mdx}" }), schema: ({ image }) => z.object({ title: z.string(), description: z.string(), pubDate: z.coerce.date(), coverImage: image().optional(), coverImageAlt: z.string().optional(), updatedDate: z.coerce.date().optional(), }),});
export const collections = { blog };