Skip to content

Commit

Permalink
feat(blog): fix blog schema
Browse files Browse the repository at this point in the history
  • Loading branch information
noghartt committed Jul 16, 2024
1 parent e82b5c1 commit bacf4ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
slug: "not-about-writing-but-about-reviewing"
title: "Not about writing, but about reviewing"
pubDate: 2024-07-13T02:19:37.399Z
draft: draft
draft: true
tags:
- writing
---
Expand Down
8 changes: 7 additions & 1 deletion src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@ import { defineCollection, z } from 'astro:content';
import { rssSchema } from '@astrojs/rss';

const blogCollection = defineCollection({
type: 'content',
schema: z
.object({
slug: z.string().optional(),
title: z.string(),
pubDate: z.coerce.date(),
tags: z.optional(z.array(z.string())),
draft: z.boolean().optional(),
})
.merge(rssSchema)
});

const listsCollection = defineCollection({
type: 'content',
schema: z
.object({
tags: z.optional(z.array(z.string())),
})
.merge(rssSchema)
});

export const collection = {
export const collections = {
blog: blogCollection,
lists: listsCollection,
}

0 comments on commit bacf4ac

Please sign in to comment.