summaryrefslogtreecommitdiff
path: root/src/content.config.ts
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2024-12-24 08:42:19 +0000
committerJoe Carstairs <me@joeac.net>2024-12-24 09:00:24 +0000
commita8efefc12f21fc3b1fe3c32898cd50d0067b93c6 (patch)
treee2224a7dbd15c5f7c4693ca438e7d83027856a69 /src/content.config.ts
parent5515d5b2cce3cc43996850ff516fd1838f8fe8eb (diff)
Upgrades to Astro 5
Diffstat (limited to 'src/content.config.ts')
-rw-r--r--src/content.config.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/content.config.ts b/src/content.config.ts
new file mode 100644
index 0000000..af3f25d
--- /dev/null
+++ b/src/content.config.ts
@@ -0,0 +1,14 @@
+import { glob } from 'astro/loaders';
+import { defineCollection, z } from 'astro:content';
+
+const news = defineCollection({
+ loader: glob({ pattern: '**/*.(md|mdx|html)', base: './src/content/news' }),
+ schema: z.object({
+ title: z.string(),
+ summary: z.string(),
+ }),
+});
+
+export const collections = {
+ news,
+};