mirror of
https://codeberg.org/JasterV/jaster.xyz.git
synced 2026-04-26 18:10:01 +00:00
16 lines
452 B
TypeScript
16 lines
452 B
TypeScript
import { glob } from "astro/loaders";
|
|
import { defineCollection, z } from "astro:content";
|
|
|
|
const blog = defineCollection({
|
|
loader: glob({ base: "./src/content/blog", pattern: "**/*.{md,mdx}" }),
|
|
// Type-check frontmatter using a schema
|
|
schema: ({ image }) =>
|
|
z.object({
|
|
title: z.string(),
|
|
description: z.string().optional(),
|
|
pubDate: z.coerce.date(),
|
|
image: image(),
|
|
}),
|
|
});
|
|
|
|
export const collections = { blog };
|