2026-04-09 08:47:37 +00:00
|
|
|
import { defineCollection } from "astro:content";
|
|
|
|
|
import { glob } from "astro/loaders";
|
|
|
|
|
import { z } from "astro/zod";
|
2024-09-04 21:16:37 +00:00
|
|
|
|
|
|
|
|
const blog = defineCollection({
|
2026-04-09 08:47:37 +00:00
|
|
|
loader: glob({ pattern: "**/*.md", base: "./src/content/blog" }),
|
2024-09-04 21:16:37 +00:00
|
|
|
schema: z.object({
|
2025-06-14 11:47:17 +00:00
|
|
|
basedOn: z.optional(z.string()),
|
2025-06-14 11:25:17 +00:00
|
|
|
dateModified: z.coerce.date(),
|
|
|
|
|
datePublished: z.coerce.date(),
|
2024-09-04 21:16:37 +00:00
|
|
|
description: z.string(),
|
2024-10-02 23:04:27 +00:00
|
|
|
draft: z.optional(z.boolean()),
|
2025-06-11 17:49:14 +00:00
|
|
|
lang: z.string(),
|
2025-06-14 11:25:17 +00:00
|
|
|
title: z.string(),
|
2024-09-04 21:16:37 +00:00
|
|
|
}),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const collections = { blog };
|