25 lines
723 B
TypeScript
25 lines
723 B
TypeScript
import { defineCollection, z } from 'astro:content';
|
|
|
|
const blogCollection = defineCollection({
|
|
schema: ({ image }) => z.object({
|
|
title: z.string(),
|
|
date: z.date(),
|
|
cover: image().refine((img) => img.width >= 720, {
|
|
message: "Cover image must be at least 720 pixels wide!",
|
|
}).optional(),
|
|
coverAlt: z.string().optional(),
|
|
description: z.string().optional(),
|
|
icon: z.string().optional(),
|
|
draft: z.boolean().optional(),
|
|
featured: z.boolean().optional(),
|
|
tags: z.array(z.string()).optional(),
|
|
_layout: z.enum(['normal', 'transparent']).optional(),
|
|
})
|
|
});
|
|
|
|
export const collections = {
|
|
'blog': blogCollection,
|
|
"projects": blogCollection,
|
|
"photos": blogCollection,
|
|
};
|