website/src/content/config.ts
Max Richter feb9b21ff8
Some checks failed
Deploy to GitHub Pages / build (push) Failing after 7m4s
Deploy to GitHub Pages / deploy (push) Has been skipped
feat: some shit
2024-04-03 18:54:51 +02:00

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,
};