basic blog with release notes
This commit is contained in:
parent
945e7082cd
commit
0566b7bcb3
23 changed files with 1089 additions and 12 deletions
24
website/src/content/config.ts
Normal file
24
website/src/content/config.ts
Normal 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 };
|
||||
Loading…
Add table
Add a link
Reference in a new issue