CTAO portal demo (Astro + Sveltia)

This commit is contained in:
ctao
2026-07-24 18:09:00 +02:00
commit a1c85d73c7
16 changed files with 6118 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import { defineCollection, z } from 'astro:content';
import { glob } from 'astro/loaders';
// News/articles live as Markdown files in src/content/news/*.md.
// This is exactly what Sveltia CMS edits — the CMS writes these files, Astro
// renders them to static HTML at build time.
const news = defineCollection({
loader: glob({ pattern: '**/*.md', base: './src/content/news' }),
schema: ({ image }) =>
z.object({
title: z.string(),
description: z.string(),
date: z.coerce.date(),
category: z.string().default('news'),
author: z.string().default('CTAO'),
cover: image().optional(),
draft: z.boolean().default(false),
}),
});
export const collections = { news };