import { z, defineCollection, reference } from "astro:content";
const blogSchema = z.object({
title: z.string(),
description: z.string(),
author: z.string(),
pubDate: z.coerce.date(),
updatedDate: z.string().optional(),
heroImage: z.string().optional(),
badge: z.string().optional(),
tags: z.array(z.string()).refine(items => new Set(items).size === items.length, {
message: 'tags must be unique',
}).optional(),
});
const projectSchema = z.object({
title: z.string(),
description: z.string(),
custom_link: z.string().optional(),
updatedDate: z.coerce.date(),
badge: z.string().optional(),
checkoutUrl: z.string().optional(),
heroImage: z.string().optional(),
terms: reference("terms"),
privacy: reference("privacy")
});
const termsSchema = z.object({
title: z.string(),
updatedDate: z.coerce.date(),
});
const blogCollection = defineCollection({ schema: blogSchema });
const projectCollection = defineCollection({ schema: projectSchema });
const termsCollection = defineCollection({ schema: termsSchema });
export const collections = {
blog: blogCollection,
projects: projectCollection,
terms: termsCollection
};