feat: migrated to Astro 6
This commit is contained in:
18
src/content.config.ts
Normal file
18
src/content.config.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { defineCollection } from "astro:content";
|
||||
import { glob } from "astro/loaders";
|
||||
import { z } from "astro/zod";
|
||||
|
||||
const blog = defineCollection({
|
||||
loader: glob({ pattern: "**/*.md", base: "./src/content/blog" }),
|
||||
schema: z.object({
|
||||
basedOn: z.optional(z.string()),
|
||||
dateModified: z.coerce.date(),
|
||||
datePublished: z.coerce.date(),
|
||||
description: z.string(),
|
||||
draft: z.optional(z.boolean()),
|
||||
lang: z.string(),
|
||||
title: z.string(),
|
||||
}),
|
||||
});
|
||||
|
||||
export const collections = { blog };
|
||||
Reference in New Issue
Block a user