Upgraded to Astro 5.2.5 and fixed content collections
This commit is contained in:
parent
298b91262e
commit
eec488ddff
28 changed files with 290 additions and 198 deletions
17
src/content.config.ts
Normal file
17
src/content.config.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { z, defineCollection } from 'astro:content'
|
||||
import { glob } from 'astro/loaders';
|
||||
|
||||
const blogCollection = defineCollection({
|
||||
loader: glob({ pattern: '**/[^_]*.{md,mdx}', base: "./src/data/blog" }),
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
tags: z.array(z.string()),
|
||||
pubDate: z.date(),
|
||||
description: z.string(),
|
||||
author: z.string(),
|
||||
}),
|
||||
})
|
||||
|
||||
export const collections = {
|
||||
blog: blogCollection,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue