Skip to content

Commit

Permalink
feat(examples): make content collections type explicit
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: Bjorn Lu <[email protected]>
Co-authored-by: Florian Lefebvre <[email protected]>
  • Loading branch information
4 people authored Dec 8, 2023
1 parent a7a46b1 commit 1a4d593
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/blog/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -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(),
Expand Down
1 change: 1 addition & 0 deletions examples/portfolio/src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 1a4d593

Please sign in to comment.