Files
blogs/src/content.config.ts
T
rchou 3c2dd93d0b
Deploy on push / deploy (push) Successful in 16s
codex rebase
2026-06-10 22:46:25 -07:00

17 lines
476 B
TypeScript

import { defineCollection } from "astro:content";
import { glob } from "astro/loaders";
import { z } from "astro/zod";
const posts = defineCollection({
loader: glob({ base: "./src/content/posts", pattern: "**/*.md" }),
schema: z.object({
title: z.string(),
date: z.coerce.date(),
excerpt: z.string().default(""),
slug: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
draft: z.boolean().default(false),
}),
});
export const collections = { posts };