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
+29
View File
@@ -0,0 +1,29 @@
---
import { getCollection } from 'astro:content';
import Base from '../layouts/Base.astro';
const posts = (await getCollection('news', ({ data }) => !data.draft)).sort(
(a, b) => b.data.date.valueOf() - a.data.date.valueOf(),
);
const fmt = (d) => new Intl.DateTimeFormat('pl-PL', { dateStyle: 'long' }).format(d);
---
<Base title="CTAO Portal — Newsy" description="Aktualności obserwatorium CTAO">
<section class="container hero">
<div class="eyebrow">Cherenkov Telescope Array Observatory</div>
<h1>Aktualności i ogłoszenia</h1>
<p>Najnowsze informacje z sieci teleskopów CTAO. Treść zarządzana przez edytorów w graficznym CMS-ie, publikowana jako statyczna strona.</p>
</section>
<section class="container">
<div class="grid">
{posts.map((post) => (
<article class="card">
<span class="cat">{post.data.category}</span>
<h3><a href={`/news/${post.id}`}>{post.data.title}</a></h3>
<p>{post.data.description}</p>
<div class="meta">{post.data.author} · {fmt(post.data.date)}</div>
</article>
))}
</div>
</section>
</Base>