Added blog drafts and ui for posting them.

This commit is contained in:
scadmin
2025-12-14 22:18:10 +00:00
parent 5357cfae0e
commit 7e5e17bde1
6 changed files with 147 additions and 104 deletions

21
src/content/config.ts Normal file
View File

@@ -0,0 +1,21 @@
import { defineCollection, z } from "astro:content";
const blog = defineCollection({
type: "content",
schema: z.object({
title: z.string(),
description: z.string().optional(),
pubDate: z.coerce.date(),
updatedDate: z.coerce.date().optional(),
draft: z.boolean().optional().default(false),
// Optional if you use hero images in your layout:
heroImage: z
.object({
src: z.string(),
alt: z.string().optional(),
})
.optional(),
}),
});
export const collections = { blog };