Added blog drafts and ui for posting them.
This commit is contained in:
21
src/content/config.ts
Normal file
21
src/content/config.ts
Normal 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 };
|
||||
Reference in New Issue
Block a user