Update template to Astro 5.0, use Content Collections
This commit is contained in:
1 parent
90a26b0085
commit
444cbe1502
16 files changed
+11018
-9215
No files matched your search
@@ -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 };
|
||||
Reference in new issue
Block a user