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:
parent
a7a46b1a5d
commit
1a4d593ddb
2 changed files with 2 additions and 0 deletions
|
@ -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(),
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue