This commit is contained in:
Hadi
2026-01-01 19:06:29 +01:00
commit 8a4ca97c40
48 changed files with 3519 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
import { defineCollection, z } from "astro:content";
import { glob } from "astro/loaders";
const projects = defineCollection({
loader: glob({ pattern: "**/*.md", base: "./src/content/projects" }),
schema: ({ image }) =>
z.object({
title: z.string(),
description: z.string(),
image: image(),
tags: z.array(z.string()),
demoLink: z.string().url().optional(),
url: z.string().url().optional(),
sourceLink: z.string().url().optional(),
}),
});
const blog = defineCollection({
loader: glob({ pattern: "**/*.{md,mdx}", base: "./src/content/blog" }),
schema: ({ image }) =>
z.object({
title: z.string(),
description: z.string(),
image: image(),
publishDate: z.coerce.date(),
updatedDate: z.coerce.date().optional(),
tags: z.array(z.string()).optional(),
}),
});
export const collections = {
projects,
blog,
};