Inital commit of Astro Website

This commit is contained in:
2026-03-21 14:37:03 +01:00
commit bea1f0741d
60 changed files with 10838 additions and 0 deletions

46
src/content.config.ts Normal file
View File

@@ -0,0 +1,46 @@
import { z, defineCollection, reference } from 'astro:content';
import { glob, file } from 'astro/loaders';
const blogCollection = defineCollection({
loader: glob({ pattern: "**/*.(md|mdx)", base: "./src/content/blog" }),
schema: z.object({
title: z.string(),
summary: z.string(),
pubDate: z.date(),
}),
});
const portfolioCollection = defineCollection({
loader: glob({ pattern: "**/*.(md|mdx)", base: "./src/content/portfolio" }),
schema: z.object({
title: z.string(),
summary: z.string(),
tags: z.array(z.string()).optional(),
pubDate: z.date(),
}),
});
const bookChapters = defineCollection({
loader: file("./src/content/book/chapters.json"),
schema: z.object({
name: z.string(),
order: z.number(),
subtitle: z.string(),
})
});
const bookCollection = defineCollection({
loader: glob({ pattern: "**/*.(md|mdx)", base: "./src/content/book" }),
schema: z.object({
chapter: reference("bookChapters"),
title: z.string(),
summary: z.string().optional(),
part: z.number(),
}),
});
export const collections = {
blog: blogCollection,
portfolio: portfolioCollection,
book: bookCollection,
};