Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnguyennz committed Jan 31, 2024
1 parent b2c02a7 commit c60e45c
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 75 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"@astrojs/sitemap": "3.0.4",
"@astrojs/tailwind": "5.1.0",
"@orama/plugin-astro": "2.0.0-beta.12",
"astro": "4.1.2",
"astro-expressive-code": "0.31.0",
"astro": "4.2.3",
"astro-expressive-code": "0.32.2",
"astro-icon": "1.0.2",
"astro-seo": "0.8.0",
"clsx": "2.1.0",
Expand Down
104 changes: 57 additions & 47 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 18 additions & 26 deletions src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import { defineCollection, z, reference } from "astro:content";

const pages = defineCollection({
type: "content",
schema: () => z.object({}),
});

const tools = defineCollection({
type: "content",
schema: () =>
z.object({
name: z.string(),
url: z.string(),
order: z.number(),
}),
schema: z.object({
name: z.string(),
url: z.string(),
order: z.number(),
}),
});

const projects = defineCollection({
Expand All @@ -32,24 +26,22 @@ const projects = defineCollection({

const tags = defineCollection({
type: "content",
schema: () =>
z.object({
name: z.string(),
url: z.string(),
}),
schema: z.object({
name: z.string(),
url: z.string(),
}),
});

const posts = defineCollection({
type: "content",
schema: () =>
z.object({
title: z.string(),
date: z.date(),
lastUpdated: z.date().optional(),
tags: z.array(reference("tags")),
description: z.string(),
published: z.boolean(),
}),
schema: z.object({
title: z.string(),
date: z.date(),
lastUpdated: z.date().optional(),
tags: z.array(reference("tags")),
description: z.string(),
published: z.boolean(),
}),
});

export const collections = { pages, tools, projects, tags, posts };
export const collections = { tools, projects, tags, posts };

0 comments on commit c60e45c

Please sign in to comment.