mirror of
https://github.com/thiloho/thiloho.github.io.git
synced 2025-11-22 10:21:36 +01:00
Initialize project with general functionality
This commit is contained in:
23
src/content.config.ts
Normal file
23
src/content.config.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { defineCollection, z } from "astro:content";
|
||||
import { glob } from "astro/loaders";
|
||||
|
||||
const index = defineCollection({
|
||||
loader: glob({ pattern: "**/*.md", base: "./src/content/index" }),
|
||||
});
|
||||
|
||||
const blog = defineCollection({
|
||||
loader: glob({ pattern: "**/*.md", base: "./src/content/blog" }),
|
||||
schema: z.object({
|
||||
id: z.number().positive(),
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
pubDate: z.coerce.date(),
|
||||
modDate: z.coerce.date().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
const legal = defineCollection({
|
||||
loader: glob({ pattern: "**/*.md", base: "./src/content/legal" }),
|
||||
});
|
||||
|
||||
export const collections = { index, blog, legal };
|
||||
Reference in New Issue
Block a user