From 3f02d5f12b167514fff6eb9693b4e25c668e7a31 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Thu, 21 Nov 2024 10:45:02 +0000 Subject: feat: support new location for content config (#12475) * feat: support new location for content config * Test fixes * Handle missing dir * Handle missing content dir * chore: changes from review * Revert legacy fixtures * Clarify changeset --- examples/blog/src/content.config.ts | 16 ++++++++++++++++ examples/blog/src/content/config.ts | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 examples/blog/src/content.config.ts delete mode 100644 examples/blog/src/content/config.ts (limited to 'examples/blog/src') diff --git a/examples/blog/src/content.config.ts b/examples/blog/src/content.config.ts new file mode 100644 index 000000000..667a31cc7 --- /dev/null +++ b/examples/blog/src/content.config.ts @@ -0,0 +1,16 @@ +import { defineCollection, z } from 'astro:content'; + +const blog = defineCollection({ + type: 'content', + // Type-check frontmatter using a schema + schema: z.object({ + title: z.string(), + description: z.string(), + // Transform string to Date object + pubDate: z.coerce.date(), + updatedDate: z.coerce.date().optional(), + heroImage: z.string().optional(), + }), +}); + +export const collections = { blog }; diff --git a/examples/blog/src/content/config.ts b/examples/blog/src/content/config.ts deleted file mode 100644 index 667a31cc7..000000000 --- a/examples/blog/src/content/config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineCollection, z } from 'astro:content'; - -const blog = defineCollection({ - type: 'content', - // Type-check frontmatter using a schema - schema: z.object({ - title: z.string(), - description: z.string(), - // Transform string to Date object - pubDate: z.coerce.date(), - updatedDate: z.coerce.date().optional(), - heroImage: z.string().optional(), - }), -}); - -export const collections = { blog }; -- cgit v1.2.3