summaryrefslogtreecommitdiff
path: root/src/content/config.ts
diff options
context:
space:
mode:
authorMatthew Kosarek <matthew@matthewkosarek.xyz>2026-08-09 19:32:06 -0400
committerMatthew Kosarek <matthew@matthewkosarek.xyz>2026-08-09 19:32:06 -0400
commitedd3b0972115ebddd068ed226158ace07c706401 (patch)
treeeca3a2ffc85283a99bbce1e7b0068ff5caa78f58 /src/content/config.ts
parente51d273eff923a2c0c691d6f1d740bde74d05b56 (diff)
feature: add a reading pageHEADmaster
Diffstat (limited to 'src/content/config.ts')
-rw-r--r--src/content/config.ts21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/content/config.ts b/src/content/config.ts
index d8c4bec..74e6b89 100644
--- a/src/content/config.ts
+++ b/src/content/config.ts
@@ -1,4 +1,5 @@
import { defineCollection, z } from 'astro:content';
+import { file } from 'astro/loaders';
const posts = defineCollection({
type: 'content',
@@ -9,4 +10,22 @@ const posts = defineCollection({
}),
});
-export const collections = { posts };
+const readingEntry = z.object({
+ title: z.string(),
+ author: z.string().optional(),
+ type: z.enum(['book', 'article']).default('book'),
+ status: z.enum(['done', 'reading']).default('done'),
+ isbn: z.string().optional(),
+ url: z.string().url().optional(),
+ note: z.string().optional(),
+});
+
+const reading = defineCollection({
+ loader: file('src/content/reading.yaml'),
+ schema: z.object({
+ year: z.number(),
+ entries: z.array(readingEntry),
+ }),
+});
+
+export const collections = { posts, reading };