This commit is contained in:
2026-06-28 19:09:30 +02:00
parent 8b43e14dc7
commit 4817ccff2a
11 changed files with 1715 additions and 1098 deletions
+26
View File
@@ -0,0 +1,26 @@
import { defineCollection } from 'astro:content'
import { z } from 'astro/zod'
import { glob } from 'astro/loaders'
const blog = defineCollection({
loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/blog' }),
schema: ({ image }) =>
z.object({
title: z.string(),
description: z.string().optional(),
date: z.coerce.date(),
updatedDate: z.coerce.date().optional(),
coverImage: image().optional(),
tags: z.string().array().default([]),
}),
})
const page = defineCollection({
loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/page' }),
schema: z.object({
title: z.string(),
date: z.coerce.date(),
}),
})
export const collections = { blog, page }