templates for self-hosting game jams (or any other kind of jam tbh)
at main 648 B view raw
1import { z, defineCollection } from 'astro:content'; 2import { glob } from 'astro/loaders'; 3 4const games = defineCollection({ 5 loader: glob({ pattern: '**/*.md', base: './src/data/games' }), 6 schema: z.object({ 7 title: z.string(), 8 date: z.date(), 9 externalLink: z.httpUrl().optional(), 10 description: z.string().optional(), 11 authors: z.array(z.object()).optional(), 12 downloads: z.array(z.object()), 13 screenshots: z.array(z.file()).optional(), 14 permalink: z.string().optional(), 15 platforms: z.array(z.string()) 16 }), 17}); 18 19// Expose your defined collection to Astro 20// with the `collections` export 21export const collections = { games };