aboutsummaryrefslogtreecommitdiffstats
path: root/src/content/config.ts
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-06-12 18:30:42 -0700
committerPinapelz <yukais@pinapelz.com>2026-06-12 18:30:42 -0700
commite1ec4a112907f4aebad56b2b388eceb3969e6e88 (patch)
tree04008fb1a9c4e757507f9c7acf7d1f54ea39f364 /src/content/config.ts
parent1b076495515ac3206c00c268e75643723a3999a5 (diff)
unify microblogHEADmaster
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 b4e86c9..e2c62ca 100644
--- a/src/content/config.ts
+++ b/src/content/config.ts
@@ -18,4 +18,23 @@ const blog = defineCollection({
}),
});
-export const collections = { blog };
+const micro = defineCollection({
+ // Type-check frontmatter using a schema
+ schema: z.object({
+ title: z.string(),
+ description: z.string(),
+ // Transform string to Date object
+ pubDate: z
+ .string()
+ .or(z.date())
+ .transform((val) => new Date(val)),
+ updatedDate: z
+ .string()
+ .optional()
+ .transform((str) => (str ? new Date(str) : undefined)),
+ heroImage: z.string().optional(),
+ }),
+});
+
+
+export const collections = { blog, micro };
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage