0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

feat(examples): make content collections type explicit

Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Co-authored-by: Bjorn Lu <34116392+bluwy@users.noreply.github.com>
Co-authored-by: Florian Lefebvre <69633530+florian-lefebvre@users.noreply.github.com>
This commit is contained in:
__dil__ 2023-12-08 03:22:08 -05:00 committed by GitHub
parent a7a46b1a5d
commit 1a4d593ddb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -1,6 +1,7 @@
import { defineCollection, z } from 'astro:content';
const blog = defineCollection({
type: 'content',
// Type-check frontmatter using a schema
schema: z.object({
title: z.string(),

View file

@ -2,6 +2,7 @@ import { defineCollection, z } from 'astro:content';
export const collections = {
work: defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),