refactor: define blog schema and clean up config

This commit is contained in:
satnaing
2023-01-26 22:39:26 +06:30
parent 309f4a3c45
commit 4e7d9843d7
2 changed files with 23 additions and 12 deletions
+3 -12
View File
@@ -1,17 +1,8 @@
import { z, defineCollection } from "astro:content";
import { defineCollection } from "astro:content";
import { blogSchema } from "./schemas";
const blogCollection = defineCollection({
schema: z.object({
author: z.string(),
datetime: z.string(), // z.string().datetime() only available in Zod v3.20.2
title: z.string(),
slug: z.string().optional(),
featured: z.boolean(),
draft: z.boolean(),
tags: z.array(z.string()),
ogImage: z.string().optional(),
description: z.string(),
}),
schema: blogSchema,
});
export const collections = {