From c0367425259d422db11c21265a86a8daa0c9cd17 Mon Sep 17 00:00:00 2001 From: Shahaf Antwarg Date: Sun, 23 Aug 2026 12:37:35 +0300 Subject: [PATCH 1/2] Restyle site EIP-style with category pages and status chips --- scripts/build-site.mjs | 238 ++++++++++++++++++++++++----------------- site/style.css | 183 +++++++++++++++---------------- 2 files changed, 229 insertions(+), 192 deletions(-) diff --git a/scripts/build-site.mjs b/scripts/build-site.mjs index 0d05458..5628e92 100644 --- a/scripts/build-site.mjs +++ b/scripts/build-site.mjs @@ -1,6 +1,7 @@ -// Static site generator for aips.antseed.com. -// Reads AIPS/*.md, renders one page per AIP plus an index grouped by status. -// Output: _site/ (deployed by Cloudflare Pages on merges to main). +// Static site generator for aips.antseed.com, EIP-site style: +// a prose homepage, per-category listing pages with status sections and +// bordered tables, and one document page per AIP with status/track chips. +// Output: _site/ (deployed by Cloudflare Workers on merges to main). import { readdirSync, readFileSync, writeFileSync, mkdirSync, cpSync, existsSync } from 'node:fs'; import { join, dirname } from 'node:path'; @@ -14,6 +15,17 @@ const out = join(root, '_site'); const REPO = 'https://github.com/AntSeed/AIPs'; const STATUS_ORDER = ['Living', 'Final', 'Last Call', 'Review', 'Draft', 'Stagnant', 'Withdrawn']; +const CATEGORIES = [ + { slug: 'all', label: 'All', match: () => true }, + { slug: 'core', label: 'Core', match: (f) => f.category === 'Core' }, + { slug: 'contracts', label: 'Contracts', match: (f) => f.category === 'Contracts' }, + { slug: 'interface', label: 'Interface', match: (f) => f.category === 'Interface' }, + { slug: 'economics', label: 'Economics', match: (f) => f.category === 'Economics' }, + { slug: 'asrc', label: 'ASRC', match: (f) => f.category === 'ASRC' }, + { slug: 'meta', label: 'Meta', match: (f) => f.type === 'Meta' }, + { slug: 'informational', label: 'Informational', match: (f) => f.type === 'Informational' }, +]; + const md = new MarkdownIt({ html: true, linkify: true, typographer: true }).use(anchor, { permalink: anchor.permalink.linkInsideHeader({ symbol: '#', placement: 'after', class: 'h-anchor' }), }); @@ -49,6 +61,8 @@ function parse(file) { const renderAuthors = (author) => esc(author).replace(/\(@([A-Za-z0-9-]+)\)/g, '(@$1)'); +const statusSlug = (s) => s.toLowerCase().replace(/\s+/g, '-'); +const trackLabel = (f) => (f.category ? `${f.type}: ${f.category}` : f.type); function tocFor(body) { const items = []; @@ -66,7 +80,13 @@ function tocFor(body) { const css = readFileSync(join(root, 'site', 'style.css'), 'utf8'); -const page = ({ title, description, canonicalPath, content, extraClass = '' }) => ` +const nav = (active) => + CATEGORIES.map(({ slug, label }) => { + const href = slug === 'all' ? '/all' : `/${slug}`; + return `${label}`; + }).join('\n '); + +const page = ({ title, description, canonicalPath, content, active = '' }) => ` @@ -83,18 +103,16 @@ const page = ({ title, description, canonicalPath, content, extraClass = '' }) = - +
- + AntSeed Improvement Proposals +
+
${content} +