basic blog with release notes

This commit is contained in:
Felix Roos 2024-01-14 23:16:09 +01:00
parent 945e7082cd
commit 0566b7bcb3
23 changed files with 1089 additions and 12 deletions

View file

@ -0,0 +1,24 @@
import { defineCollection, z } from 'astro:content';
const blog = defineCollection({
// Type-check frontmatter using a schema
schema: z.object({
title: z.string(),
author: z.string(),
description: z.string().optional(),
// Transform string to Date object
date: z
.string()
.or(z.date())
.transform((val) => new Date(val)),
updatedDate: z
.string()
.optional()
.transform((str) => (str ? new Date(str) : undefined)),
image: z.string().optional(),
tags: z.array(z.string()).optional(),
draft: z.boolean().optional(),
}),
});
export const collections = { blog };