aboutsummaryrefslogtreecommitdiffstats
path: root/src/content.config.ts
diff options
context:
space:
mode:
authoraman333nolawz <amananudhiu@gmail.com>2026-03-02 21:49:13 +0530
committeraman333nolawz <amananudhiu@gmail.com>2026-03-02 21:49:13 +0530
commitd41eff9eccf66644c4c60f53cb516bf079937a28 (patch)
tree248a0863a3181369f943d678ec4273911d35efac /src/content.config.ts
Using astro-erudite for static site generation
Diffstat (limited to 'src/content.config.ts')
-rw-r--r--src/content.config.ts49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/content.config.ts b/src/content.config.ts
new file mode 100644
index 0000000..ed8186c
--- /dev/null
+++ b/src/content.config.ts
@@ -0,0 +1,49 @@
+import { glob } from 'astro/loaders'
+import { defineCollection, z } from 'astro:content'
+
+const blog = defineCollection({
+ loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/blog' }),
+ schema: ({ image }) =>
+ z.object({
+ title: z.string(),
+ description: z.string(),
+ date: z.coerce.date(),
+ order: z.number().optional(),
+ image: image().optional(),
+ tags: z.array(z.string()).optional(),
+ authors: z.array(z.string()).optional(),
+ draft: z.boolean().optional(),
+ }),
+})
+
+const authors = defineCollection({
+ loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/authors' }),
+ schema: z.object({
+ name: z.string(),
+ pronouns: z.string().optional(),
+ avatar: z.string().url().or(z.string().startsWith('/')),
+ bio: z.string().optional(),
+ mail: z.string().email().optional(),
+ website: z.string().url().optional(),
+ twitter: z.string().url().optional(),
+ github: z.string().url().optional(),
+ linkedin: z.string().url().optional(),
+ discord: z.string().url().optional(),
+ }),
+})
+
+const projects = defineCollection({
+ loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/projects' }),
+ schema: ({ image }) =>
+ z.object({
+ name: z.string(),
+ description: z.string(),
+ tags: z.array(z.string()),
+ image: image(),
+ link: z.string().url(),
+ startDate: z.coerce.date().optional(),
+ endDate: z.coerce.date().optional(),
+ }),
+})
+
+export const collections = { blog, authors, projects }