refactor: split the site generator into templates and content, add news

- templates/ holds the page chrome (base, header, footer, badges, leads)
- content/<lang>/ holds pages as HTML fragments with front matter and the chrome strings
- content/site.toml holds shared values (contact, Bitcoin address, manifesto version)
- static/style.css replaces the CSS embedded in the script
- add news: Markdown posts in content/<lang>/news/, index page, latest posts on the home page
- add [text](url) links and `code` to the Markdown renderer
- copy favicons from logo/web so a fresh clone builds the whole site
- build.py now uses the standard library only and fails on unknown placeholders
This commit is contained in:
squid 2026-11-12 18:34:55 +01:00
commit c8b7b6a571
9 changed files with 931 additions and 487 deletions

4
templates/badges.html Normal file
View file

@ -0,0 +1,4 @@
<p class="badges">
<a href="https://validator.w3.org/nu/?doc={{doc_q}}"><img src="/badges/w3c-html5.png" alt="Valid HTML5" width="63" height="64"></a>
<a href="https://jigsaw.w3.org/css-validator/validator?uri={{doc_q}}&amp;profile=css3svg"><img src="/badges/w3c-css.png" alt="Valid CSS" width="88" height="31"></a>
</p>

24
templates/base.html Normal file
View file

@ -0,0 +1,24 @@
<!doctype html>
<html lang="{{lang}}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="color-scheme" content="light dark">
<meta name="robots" content="noindex, nofollow, noarchive">
<meta name="description" content="{{description_attr}}">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
{{alt_links}}
<style>
{{css}}
</style>
<title>{{title_html}}</title>
</head>
<body>
{{header}}
{{content}}
{{footer}}
</body>
</html>

7
templates/footer.html Normal file
View file

@ -0,0 +1,7 @@
<footer>
{{lead}}
<p>
{{nojs}}
</p>
{{badges}}
</footer>

17
templates/header.html Normal file
View file

@ -0,0 +1,17 @@
<header>
<nav aria-label="{{sections}}">
<p>
<a href="{{home_link}}"{{cur_home}}>kmalloc.org</a>
&middot;
<a href="{{url_manifesto}}"{{cur_manifesto}}>{{nav_manifesto}}</a>
&middot;
<a href="{{url_people}}"{{cur_people}}>{{nav_people}}</a>
&middot;
<a href="{{url_services}}"{{cur_services}}>{{nav_services}}</a>
&middot;
<a href="{{url_news}}"{{cur_news}}>{{nav_news}}</a>
&middot;
<a href="{{alt_switch}}" hreflang="{{other}}" lang="{{other}}">{{other_name}}</a>
</p>
</nav>
</header>

View file

@ -0,0 +1,10 @@
<h2 id="news">{{nav_news}}</h2>
<p>
{{news_p}}
<a href="{{url_news}}">{{news_all}}</a>.
</p>
<ul>
{{news_items}}
</ul>

3
templates/lead-back.html Normal file
View file

@ -0,0 +1,3 @@
<p>
<a href="{{home_link}}">{{back}}</a>
</p>

3
templates/lead-home.html Normal file
View file

@ -0,0 +1,3 @@
<p>
<em>Free Your Mind&hellip; and Your Ass Will Follow.</em>
</p>

5
templates/lead-news.html Normal file
View file

@ -0,0 +1,5 @@
<p>
<a href="{{url_news}}">{{news_all}}</a>
&middot;
<a href="{{home_link}}">{{back}}</a>
</p>

7
templates/news-post.html Normal file
View file

@ -0,0 +1,7 @@
<h1>{{post_title}}</h1>
<p>
<time datetime="{{date}}">{{date}}</time>
</p>
{{post_body}}