Files
homepage_relaunch/src/content.config.ts
T
2026-09-18 16:04:05 +02:00

25 lines
707 B
TypeScript

import { defineCollection } from 'astro:content';
import { z } from 'astro/zod';
import { glob } from 'astro/loaders';
const insights = defineCollection({
loader: glob({ pattern: '**/*.md', base: './src/content/insights' }),
schema: ({ image }) =>
z.object({
title: z.string(),
subtitle: z.string().optional(),
description: z.string(),
date: z.coerce.date(),
lang: z.enum(['en', 'de']),
category: z.string(),
readingTime: z.number().int().positive(),
author: z.string(),
authorRole: z.string(),
cover: image(),
coverAlt: z.string(),
tags: z.array(z.string()).default([]),
}),
});
export const collections = { insights };