première publication

This commit is contained in:
2026-01-11 15:54:07 +04:00
parent bba4534872
commit 34e5c342f8
9 changed files with 246 additions and 18 deletions

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

@@ -0,0 +1,31 @@
// 1. Importer les utilitaires de `astro:content`
import { z, defineCollection } from 'astro:content';
// 2. Définir une collection pour le journal d'aventure
const journalCollection = defineCollection({
type: 'content', // 'content' pour les fichiers .md ou .mdx
schema: z.object({
title: z.string(),
author: z.string(),
publishDate: z.date(),
image: z.object({
src: z.string(),
alt: z.string(),
}).optional(),
}),
});
// 3. Définir une collection pour les logs de construction
const logsCollection = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
publishDate: z.date(),
}),
});
// 4. Exporter les collections pour les enregistrer
export const collections = {
'journal': journalCollection,
'logs': logsCollection,
};