feat: portal IA per spec (home entry point, /news, /proposals+redirect, /support), live search + suggestions, article TOC, mobile disclosure menu, CMS preview styles, modernization pass 1

This commit is contained in:
ctao
2026-07-24 23:00:07 +02:00
parent 11e7eb484f
commit cf35739a64
17 changed files with 627 additions and 231 deletions
+19
View File
@@ -0,0 +1,19 @@
// Build-time search index (Astro static endpoint — no server, no dependencies).
// Kept lean: title/description/category/date/slug only (~60 KB for 200+ articles).
import { getCollection } from 'astro:content';
export async function GET() {
const posts = await getCollection('news', ({ data }) => !data.draft);
const index = posts
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf())
.map((p) => ({
slug: p.id,
title: p.data.title,
description: p.data.description,
category: p.data.category,
date: p.data.date.toISOString().slice(0, 10),
}));
return new Response(JSON.stringify(index), {
headers: { 'Content-Type': 'application/json; charset=utf-8' },
});
}