Update template to Astro 5.0, use Content Collections

This commit is contained in:
Cassidy Williams committed 2024-12-14 09:46:58 -06:00
1 parent 90a26b0085
commit 444cbe1502
16 files changed
+11018 -9215

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import { defineCollection, z } from "astro:content";
import { glob } from "astro/loaders";
const posts = defineCollection({
loader: glob({ pattern: "*.md", base: "./src/posts" }),
schema: z.object({
title: z.string(),
slug: z.string(),
description: z.string(),
added: z.union([z.string(), z.date()]),
updated: z.union([z.string(), z.date()]).optional(),
tags: z.array(z.string()),
}),
});
export const collections = { posts };