mirror of
https://github.com/cupcakearmy/nicco.io.git
synced 2026-10-23 02:51:46 +00:00
updates
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { defineCollection } from 'astro:content'
|
||||
import { z } from 'astro/zod'
|
||||
import { glob } from 'astro/loaders'
|
||||
|
||||
const blog = defineCollection({
|
||||
loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/blog' }),
|
||||
schema: ({ image }) =>
|
||||
z.object({
|
||||
title: z.string(),
|
||||
description: z.string().optional(),
|
||||
date: z.coerce.date(),
|
||||
updatedDate: z.coerce.date().optional(),
|
||||
coverImage: image().optional(),
|
||||
tags: z.string().array().default([]),
|
||||
}),
|
||||
})
|
||||
|
||||
const page = defineCollection({
|
||||
loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/page' }),
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
date: z.coerce.date(),
|
||||
}),
|
||||
})
|
||||
|
||||
export const collections = { blog, page }
|
||||
Reference in New Issue
Block a user