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
29 changed files with 931 additions and 487 deletions

View file

@ -2,10 +2,49 @@
Sources of the kmalloc.org website: plain static HTML, no JavaScript, valid HTML5 and CSS.
- `build.py` generates the pages: `python3 build.py <output-dir>`.
## Layout
- `build.py` generates the site: `python3 build.py [output-dir]` (default `preview/`). Standard library only.
- `templates/` holds the page chrome: `base.html`, `header.html`, `footer.html` and a few small fragments.
- `static/style.css` is the one stylesheet, inlined into every page.
- `content/site.toml` holds the values shared by every page: contact address, Bitcoin address, manifesto version.
- `content/<lang>/lang.toml` holds the chrome strings of one language (`en`, `it`).
- `content/<lang>/*.html` are the pages: a front matter block, then an HTML fragment.
- `content/<lang>/news/` holds the news posts.
- `MANIFESTO.en.md` and `MANIFESTO.it.md` are the manifesto texts, version 1.0.
- `fonts/terminess.woff2` is Terminess (Terminus), SIL Open Font License, subset to Latin.
- `badges/` holds the official W3C badges, served from our own site.
- `logo/` holds the shrike logo: SVG and PNG exports, `build_logo.py` and the original PNG.
- `logo/` holds the shrike logo: SVG and PNG exports, `build_logo.py`, the original PNG and the favicons in `logo/web/`.
I check every page with the Nu HTML Checker before publishing, then copy the output to the web root.
## Pages
A page starts with a front matter block, then the HTML fragment:
---
id: people
path: /people.html
nav: people
title: kmalloc.org: People
description: The people behind kmalloc.org.
---
<h1>People</h1>
`id` pairs a page with its translation, `nav` is the menu entry to highlight. Placeholders such as `{{contact_shown}}` or `{{url_news}}` are replaced at build time, and an unknown placeholder stops the build.
## News
A post is a Markdown file named `YYYY-MM-DD-slug.md` in `content/<lang>/news/`:
---
title: Hello
summary: One line shown in the list.
---
Text with a [link](https://kmalloc.org/) and `code`.
## A heading
The post is published at `/news/slug.html` (`/it/news/slug.html` for Italian). A post with the same file name in both languages is linked as a translation. The news index and the latest three posts on the home page are built from the files. No em dashes: the build refuses them.
## Publishing
I check every page with the Nu HTML Checker, then copy the output to the web root on the server.

696
build.py
View file

@ -1,353 +1,96 @@
#!/usr/bin/env python3
"""Build the kmalloc.org static site (plain HTML, no JavaScript) from the manifesto sources.
Usage: build.py <output-dir> (writes index.html, manifesto.html, it/index.html, it/manifesto.html)"""
import html, os, re, sys
"""Build the kmalloc.org static site (plain HTML, no JavaScript, standard library only).
Usage: build.py [output-dir] (default: preview)
Layout:
templates/ page chrome: base.html, header.html, footer.html, ...
static/style.css the one stylesheet, inlined into every page
content/site.toml values shared by every page (contact, bitcoin address, manifesto version)
content/<lang>/lang.toml the chrome strings of one language
content/<lang>/*.html pages: front matter, then an HTML fragment
content/<lang>/news/*.md news posts: YYYY-MM-DD-slug.md, front matter, then Markdown
A page starts with a front matter block:
---
id: people pairs the page with its translation
path: /people.html where it is published
nav: people menu entry highlighted on this page
title: ...
description: ...
---
Placeholders {{name}} are replaced with values from site.toml, lang.toml and the page itself.
An unknown placeholder stops the build."""
import html, os, re, shutil, sys, tomllib
HERE = os.path.dirname(os.path.abspath(__file__))
OUT = sys.argv[1]
OUT = os.path.abspath(sys.argv[1] if len(sys.argv) > 1 else os.path.join(HERE, "preview"))
LANGS = ("en", "it")
NAV = ("home", "manifesto", "people", "services", "news")
NEWS_ON_HOME = 3
POST_NAME = re.compile(r"^(\d{4}-\d{2}-\d{2})-([a-z0-9]+(?:-[a-z0-9]+)*)$")
CSS = """@font-face {
font-family: "Terminess";
src: url("/fonts/terminess.woff2") format("woff2");
font-display: swap;
}
:root {
--bg: #F9F7ED;
--surface: #F1EDE0;
--border: #D9D3C2;
--text: #111417;
--muted: #5b564a;
--accent: #D9480F;
--link: #b13a0b;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #111417;
--surface: #1b1f23;
--border: #5b564a;
--text: #F9F7ED;
--muted: #8a8473;
--link: #f0683a;
}
}
body {
margin: 0 auto;
max-width: 40em;
padding: 1em;
background-color: var(--bg);
color: var(--text);
font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
line-height: 1.6;
}
h1, h2, h3 {
margin: 2em 0 .5em;
font-family: "Terminess", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
font-weight: normal;
line-height: 1.25;
}
a {
color: var(--link);
}
a:visited {
color: var(--muted);
}
a:hover, header a[aria-current] {
color: var(--text);
}
a:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
header {
border-bottom: 1px solid var(--border);
line-height: 2;
}
header a[aria-current] {
text-decoration: none;
}
footer {
margin-top: 3em;
border-top: 1px solid var(--border);
color: var(--muted);
font-size: .875em;
}
blockquote {
margin: 1.5em 0;
padding: 0 1em;
border-left: 4px solid var(--accent);
}
code {
background-color: var(--surface);
color: var(--text);
font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
font-size: .9375em;
overflow-wrap: anywhere;
}
.hero {
margin: .5em 0 .4em;
font-size: 3em;
line-height: 1.1;
}
@media (max-width: 30em) {
.hero {
font-size: 2em;
}
}
.logo {
width: 7em;
height: auto;
}
@media print {
:root {
--bg: #fff;
--border: #000;
--text: #000;
--muted: #000;
--link: #000;
}
header, .badges {
display: none;
}
a[href^="http"]::after {
content: " <" attr(href) ">";
}
h1, h2, h3 {
page-break-after: avoid;
}
}"""
SERVICES = [
# (url, name, en, it)
("https://git.kmalloc.org/", "git", "code hosting (Forgejo)", "repository di codice (Forgejo)"),
("https://social.kmalloc.org/@squid", "social", "Mastodon, accounts on approval", "Mastodon, account su approvazione"),
("https://lists.kmalloc.org/", "lists", "mailing lists (Mailman 3)", "liste di posta (Mailman 3)"),
("https://chat.kmalloc.org/", "chat", "XMPP, web client", "XMPP, client web"),
("https://element.kmalloc.org/", "matrix", "Matrix, Element web client", "Matrix, client web Element"),
("https://meet.kmalloc.org/", "meet", "video conferences (Jitsi Meet)", "videoconferenze (Jitsi Meet)"),
("https://webmail.kmalloc.org/", "webmail", "email on our own server", "posta sul nostro server"),
]
MANIFESTO_VERSION = "1.0"
CONTACT = "squid@kmalloc.org"
CONTACT_SHOWN = CONTACT.replace("@", " (at) ") # shown instead of a mailto link, against address harvesters
BTC = "bc1qsj5qadrzlqmfwcru4fwuqvftg833te5f9mja2c"
SERVICE_PAGES = [
# id, name, url, EN text, IT text
("mail", "Email", "https://webmail.kmalloc.org/",
"An address @kmalloc.org on our own mail server, with webmail and support for any standard mail client. IMAP: mail.kmalloc.org, port 993 (TLS). SMTP submission: mail.kmalloc.org, port 465 (TLS). Outgoing mail is signed with DKIM and protected by SPF and DMARC.",
"Un indirizzo @kmalloc.org sul nostro server di posta, con webmail e supporto per qualsiasi client di posta standard. IMAP: mail.kmalloc.org, porta 993 (TLS). Invio SMTP: mail.kmalloc.org, porta 465 (TLS). La posta in uscita è firmata con DKIM e protetta da SPF e DMARC."),
("lists", "Mailing lists", "https://lists.kmalloc.org/",
"Mailing lists with web archives (Mailman 3). Lists live under @lists.kmalloc.org. If you need one, ask.",
"Liste di posta con archivi consultabili sul web (Mailman 3). Le liste stanno sotto @lists.kmalloc.org. Se te ne serve una, chiedila."),
("git", "Git", "https://git.kmalloc.org/",
"Code hosting with Forgejo: repositories, issues and pull requests. Git over SSH uses port 2222. Reading public repositories needs no account.",
"Hosting di codice con Forgejo: repository, issue e pull request. Git via SSH usa la porta 2222. Per leggere i repository pubblici non serve un account."),
("social", "Mastodon", "https://social.kmalloc.org/",
"A Mastodon server. Your address is @name@social.kmalloc.org. You can ask for an account on the site itself: requests are approved by hand.",
"Un server Mastodon. Il tuo indirizzo è @nome@social.kmalloc.org. L'account si può chiedere direttamente sul sito: le richieste si approvano a mano."),
("chat", "XMPP chat", "https://chat.kmalloc.org/",
"Instant messaging with XMPP: address name@kmalloc.org, group rooms on conference.kmalloc.org, file sharing, and audio and video calls through our own TURN server. Use the web client or any XMPP app (server kmalloc.org, port 5222).",
"Messaggistica con XMPP: indirizzo nome@kmalloc.org, stanze di gruppo su conference.kmalloc.org, condivisione di file e chiamate audio e video con un nostro server TURN. Usa il client web o qualsiasi app XMPP (server kmalloc.org, porta 5222)."),
("matrix", "Matrix", "https://element.kmalloc.org/",
"A Matrix homeserver: address @name:kmalloc.org. Use the Element web client or any Matrix app with homeserver matrix.kmalloc.org.",
"Un homeserver Matrix: indirizzo @nome:kmalloc.org. Usa il client web Element o qualsiasi app Matrix con homeserver matrix.kmalloc.org."),
("meet", "Video conferences", "https://meet.kmalloc.org/",
"Video conferences with Jitsi Meet. Anyone with the link can join a room; creating a room needs an account.",
"Videoconferenze con Jitsi Meet. Chiunque abbia il link può entrare in una stanza; per crearne una serve un account."),
]
PEOPLE = [
# handle, display name (empty = handle only), bio EN, bio IT, links (label, url)
("squid", "",
"I'm squid. I run kmalloc.org, write code and maintain the services on this site. I have been into computers since I was ten, when I got an IBM PS/2 with a 486DX and played Gorilla, a QBasic game: ever since, I have been taking things apart to understand how they work. Outside of work: retro computing, science fiction and extreme metal.",
"Sono squid. Gestisco kmalloc.org, scrivo codice e mantengo i servizi di questo sito. Mi appassionano i computer da quando, a dieci anni, ebbi un IBM PS/2 con un 486DX e giocai a Gorilla, un gioco in QBasic: da allora smonto le cose per capire come funzionano. Fuori dal lavoro: retrocomputing, fantascienza ed extreme metal.",
[("Mastodon", "https://social.kmalloc.org/@squid"), ("git", "https://git.kmalloc.org/squid")]),
]
T = {
"en": dict(
lang="en", other="it", other_name="Italiano", other_home="/it/", other_man="/it/manifesto.html", home="/", home_link="/?lang=en", man="/manifesto.html", ppl="/people.html", other_ppl="/it/persone.html", svc="/services.html", other_svc="/it/servizi.html",
title="kmalloc.org: Technology. Freedom. Dissent.",
desc="kmalloc.org is an independent hacker space that promotes free software, privacy and an open Internet.",
tagline="Technology. Freedom. Dissent.",
identity="kmalloc.org is a hacker, antifascist, ethical space.",
intro="kmalloc.org is an independent hacker space that promotes free software, privacy and an open Internet, defending freedom of thought, the dignity of work and the right of people not to be controlled, exploited or subordinated to arbitrary powers.",
manifesto_h="Manifesto", manifesto_p="What we believe, in twelve points and a few commitments:", manifesto_a="read the manifesto",
services_h="Services", services_p="Run on our own server, with free software. Accounts are created by hand.",
nojs="This page uses no JavaScript, cookies or trackers.", back="home", toc="Contents",
man_title="kmalloc.org: Manifesto", man_desc="The kmalloc.org manifesto: free software, privacy, an open Internet, dignity at work.",
people_h="People", people_p="Who is behind kmalloc.org.", people_a="meet the people", people_title="kmalloc.org: People", people_desc="The people behind kmalloc.org.", links="Links", sections="Sections", version="Version",
svc_title="kmalloc.org: Services", svc_desc="The services run by kmalloc.org: email, git, Mastodon, XMPP, Matrix, mailing lists and video conferences. Free, by request.",
svc_intro="These services run on our own server, with free software, for people who want an alternative to the big platforms.",
at_hint="replace (at) with @", free_h="Get an account", free_p1="The services are free of charge. To ask for an account, write to", free_p2="telling us which services you want and the username you would like.",
donate_h="Support kmalloc.org", donate_p="Donations are welcome and help keep the server running. Bitcoin address:", donate_a="send a donation",
terms_h="Good to know", terms_p="Everything is run by one person on one server, with nightly encrypted backups and no guarantees of availability. Be respectful: the manifesto explains what we stand for.",
open_a="open",
),
"it": dict(
lang="it", other="en", other_name="English", other_home="/", other_man="/manifesto.html", home="/it/", home_link="/it/", man="/it/manifesto.html", ppl="/it/persone.html", other_ppl="/people.html", svc="/it/servizi.html", other_svc="/services.html",
title="kmalloc.org: Technology. Freedom. Dissent.",
desc="kmalloc.org è uno spazio hacker indipendente che promuove il software libero, la privacy e un Internet aperto.",
tagline="Technology. Freedom. Dissent.",
identity="kmalloc.org è uno spazio hacker, antifascista, etico.",
intro="kmalloc.org è uno spazio hacker indipendente che promuove il software libero, la privacy e un Internet aperto, difendendo la libertà di pensiero, la dignità del lavoro e il diritto delle persone a non essere controllate, sfruttate o subordinate a poteri arbitrari.",
manifesto_h="Manifesto", manifesto_p="Quello in cui crediamo, in dodici punti e qualche impegno:", manifesto_a="leggi il manifesto",
services_h="Servizi", services_p="Girano sul nostro server, con software libero. Gli account si creano a mano.",
nojs="Questa pagina non usa JavaScript, cookie né tracker.", back="home", toc="Indice",
man_title="kmalloc.org: Manifesto", man_desc="Il manifesto di kmalloc.org: software libero, privacy, un Internet aperto, dignità nel lavoro.",
people_h="Persone", people_p="Chi c'è dietro kmalloc.org.", people_a="conosci le persone", people_title="kmalloc.org: Persone", people_desc="Le persone dietro kmalloc.org.", links="Link", sections="Sezioni", version="Versione",
svc_title="kmalloc.org: Servizi", svc_desc="I servizi di kmalloc.org: posta, git, Mastodon, XMPP, Matrix, liste di posta e videoconferenze. Gratuiti, su richiesta.",
svc_intro="Questi servizi girano sul nostro server, con software libero, per chi vuole un'alternativa alle grandi piattaforme.",
at_hint="sostituisci (at) con @", free_h="Richiedi un account", free_p1="I servizi sono gratuiti. Per chiedere un account scrivi a", free_p2="indicando quali servizi vuoi e il nome utente che preferisci.",
donate_h="Sostieni kmalloc.org", donate_p="Le donazioni sono benvenute e aiutano a tenere acceso il server. Indirizzo Bitcoin:", donate_a="fai una donazione",
terms_h="Da sapere", terms_p="Tutto è gestito da una persona su un solo server, con backup notturni cifrati e nessuna garanzia di disponibilità. Siate rispettosi: il manifesto spiega in cosa crediamo.",
open_a="apri",
),
# Files copied as they are: published name -> source.
ASSETS = {
"favicon.svg": "logo/svg/favicon-auto.svg",
"favicon-auto.svg": "logo/svg/favicon-auto.svg",
"logo-auto.svg": "logo/svg/logo-auto.svg",
"favicon.ico": "logo/web/favicon.ico",
"apple-touch-icon.png": "logo/web/apple-touch-icon.png",
"fonts/terminess.woff2": "fonts/terminess.woff2",
"badges/w3c-html5.png": "badges/w3c-html5.png",
"badges/w3c-css.png": "badges/w3c-css.png",
}
def badges(url):
q = url.replace(":", "%3A").replace("/", "%2F")
return f"""<p class="badges">
<a href="https://validator.w3.org/nu/?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={q}&amp;profile=css3svg"><img src="/badges/w3c-css.png" alt="Valid CSS" width="88" height="31"></a>
</p>"""
def fail(msg):
raise SystemExit(f"build.py: {msg}")
def nav(t, other_url, current):
"""Site menu at the top of every page: sections plus the language switch."""
cur = lambda k: ' aria-current="page"' if k == current else ""
if current == "home" and t["lang"] == "it":
other_url = "/?lang=en"
return f"""<header>
<nav aria-label="{t['sections']}">
<p>
<a href="{t['home_link']}"{cur('home')}>kmalloc.org</a>
&middot;
<a href="{t['man']}"{cur('man')}>{t['manifesto_h']}</a>
&middot;
<a href="{t['ppl']}"{cur('ppl')}>{t['people_h']}</a>
&middot;
<a href="{t['svc']}"{cur('svc')}>{t['services_h']}</a>
&middot;
<a href="{other_url}" hreflang="{t['other']}" lang="{t['other']}">{t['other_name']}</a>
</p>
</nav>
</header>"""
def read(*parts):
with open(os.path.join(HERE, *parts), encoding="utf-8") as f:
return f.read()
def page(t, title, desc, body, alt_url, here_url):
other = T[t["other"]]
return f"""<!doctype html>
<html lang="{t['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="{html.escape(desc, quote=True)}">
<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">
<link rel="alternate" hreflang="{other['lang']}" href="{alt_url}">
<link rel="alternate" hreflang="{t['lang']}" href="{here_url}">
<style>
{CSS}
</style>
<title>{html.escape(title)}</title>
</head>
<body>
{body}
</body>
</html>
"""
def home(t):
li = "\n".join(
f'<li><a href="{u}">{n}</a>: {html.escape(t["lang"] == "en" and en or it)}</li>'
for (u, n, en, it) in SERVICES)
body = f"""{nav(t, t['other_home'], 'home')}
def write(rel, text):
path = os.path.join(OUT, rel)
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, "w", encoding="utf-8") as f:
f.write(text)
<p>
<img class="logo" src="/logo-auto.svg" alt="kmalloc" width="112">
</p>
<h1 class="hero">Technology.<br>Freedom.<br>Dissent.</h1>
def toml(*parts):
with open(os.path.join(HERE, *parts), "rb") as f:
return tomllib.load(f)
<p>
<strong>{html.escape(t['identity'])}</strong>
</p>
<p>
{html.escape(t['intro'])}
</p>
def parse(text, name):
"""Split 'front matter, then body' into (dict, body)."""
m = re.match(r"---\n(.*?)\n---\n(.*)\Z", text, re.S)
if not m:
fail(f"{name}: missing front matter")
meta = {}
for line in m.group(1).splitlines():
key, sep, value = line.partition(": ")
if not sep:
fail(f"{name}: bad front matter line {line!r}")
meta[key.strip()] = value.strip()
return meta, m.group(2)
<p>
<strong>Allocate freedom.</strong>
</p>
<h2 id="manifesto">{t['manifesto_h']}</h2>
def render(text, ctx, name):
def sub(m):
if m.group(1) not in ctx:
fail(f"{name}: unknown placeholder {{{{{m.group(1)}}}}}")
return ctx[m.group(1)]
return re.sub(r"\{\{(\w+)\}\}", sub, text)
<p>
{t['manifesto_p']}
<a href="{t['man']}">{t['manifesto_a']}</a> ({t['version'].lower()} {MANIFESTO_VERSION}).
</p>
<h2 id="people">{t['people_h']}</h2>
<p>
{t['people_p'].rstrip('.')}:
<a href="{t['ppl']}">{t['people_a']}</a>.
</p>
<h2 id="services">{t['services_h']}</h2>
<p>
{t['services_p']}
<a href="{t['svc']}">{t['free_h'].lower()}</a>.
</p>
<ul>
{li}
</ul>
<footer>
<p>
<em>Free Your Mind&hellip; and Your Ass Will Follow.</em>
</p>
<p>
{t['nojs']}
</p>
{badges("https://kmalloc.org" + t["home"])}
</footer>"""
return page(t, t["title"], t["desc"], body, t["other_home"], t["home"])
# ---------------------------------------------------------------- Markdown
def no_em_dash(md):
"""Replace every em dash: headings 'NN — Title' -> 'NN. Title', 'Word — Title' -> 'Word: Title',
attribution lines lose the dash, parenthetical dashes become commas."""
"""The manifesto sources use em dashes; the site does not: headings 'NN — Title' become 'NN. Title',
'Word — Title' becomes 'Word: Title', attribution lines lose the dash, parenthetical dashes become commas."""
md = re.sub(r"^(#+ )(\d\d) — ", r"\1\2. ", md, flags=re.M)
md = re.sub(r"^(#+ [^\d\n][^—\n]*?) — ", r"\1: ", md, flags=re.M)
md = re.sub(r"^> — ", "> ", md, flags=re.M)
@ -360,189 +103,198 @@ def no_em_dash(md):
assert "—" not in md, [l for l in md.splitlines() if "—" in l]
return md
def inline(s):
s = html.escape(s, quote=False)
s = re.sub(r"`([^`]+)`", r"<code>\1</code>", s)
s = re.sub(r"\[([^\]]+)\]\(([^)\s]+)\)", r'<a href="\2">\1</a>', s)
s = re.sub(r"\*\*(.+?)\*\*", r"<strong>\1</strong>", s)
s = re.sub(r"(?<!\*)\*(?!\s)(.+?)(?<!\s)\*(?!\*)", r"<em>\1</em>", s)
return s
def slug(heading):
m = re.match(r"(\d\d)\b", heading)
if m: return m.group(1)
if m:
return m.group(1)
h = heading.lower()
if h.startswith(("preamble", "preambolo")): return "preamble"
if h.startswith(("our commitments", "i nostri impegni")): return "commitments"
if h.startswith(("epilogue", "epilogo")): return "epilogue"
if h.startswith(("preamble", "preambolo")):
return "preamble"
if h.startswith(("our commitments", "i nostri impegni")):
return "commitments"
if h.startswith(("epilogue", "epilogo")):
return "epilogue"
return re.sub(r"[^a-z0-9]+", "-", h).strip("-")
def md_to_html(md):
lines = md.splitlines()
"""Headings (##), paragraphs, quotes, bullet lists and inline markup. Returns (title, toc, html)."""
out, toc = [], []
para, quote, items = [], [], []
def flush():
nonlocal para, quote, items
if para:
out.append("<p>\n" + "\n".join(para) + "\n</p>\n"); para = []
out.append("<p>\n" + "\n".join(para) + "\n</p>\n")
para = []
if quote:
out.append("<blockquote>\n<p>\n" + "\n".join(quote) + "\n</p>\n</blockquote>\n"); quote = []
out.append("<blockquote>\n<p>\n" + "\n".join(quote) + "\n</p>\n</blockquote>\n")
quote = []
if items:
out.append("<ul>\n" + "\n".join(f"<li>{i}</li>" for i in items) + "\n</ul>\n"); items = []
out.append("<ul>\n" + "\n".join(f"<li>{i}</li>" for i in items) + "\n</ul>\n")
items = []
title = ""
for raw in lines:
for raw in md.splitlines():
line = raw.rstrip("\n")
br = line.endswith(" ")
s = line.strip()
if not s:
flush(); continue
flush()
continue
if s.startswith("# "):
flush(); title = s[2:]; continue
flush()
title = s[2:]
continue
if s.startswith("## "):
flush(); h = s[3:]; sl = slug(h); toc.append((sl, h))
out.append(f'<h2 id="{sl}">{inline(h)}</h2>\n'); continue
flush()
h = s[3:]
sl = slug(h)
toc.append((sl, h))
out.append(f'<h2 id="{sl}">{inline(h)}</h2>\n')
continue
if s.startswith("> "):
if para or items: flush()
quote.append(inline(s[2:]) + ("<br>" if br else "")); continue
if para or items:
flush()
quote.append(inline(s[2:]) + ("<br>" if br else ""))
continue
if s.startswith("- "):
if para or quote: flush()
items.append(inline(s[2:])); continue
if quote or items: flush()
if para or quote:
flush()
items.append(inline(s[2:]))
continue
if quote or items:
flush()
para.append(inline(s))
flush()
return title, toc, "".join(out)
def manifesto(t):
src = open(os.path.join(HERE, f"MANIFESTO.{t['lang']}.md"), encoding="utf-8").read()
title, toc, body_html = md_to_html(no_em_dash(src))
toc_html = "\n".join(f'<li><a href="#{sl}">{inline(h)}</a></li>' for sl, h in toc)
body = f"""{nav(t, t['other_man'], 'man')}
<h1>{html.escape(title)}</h1>
# ---------------------------------------------------------------- site model
<p>
<strong>{t['version']} {MANIFESTO_VERSION}</strong>
</p>
<h2>{t['toc']}</h2>
<ul>
{toc_html}
</ul>
{body_html}
<footer>
<p>
<a href="{t['home_link']}">{t['back']}</a>
</p>
<p>
{t['nojs']}
</p>
{badges("https://kmalloc.org" + t["man"])}
</footer>"""
return page(t, t["man_title"], t["man_desc"], body, t["other_man"], t["man"])
def load_pages(lang):
"""Pages of one language: static pages from content/<lang>/*.html and posts from content/<lang>/news/*.md."""
pages = []
folder = os.path.join(HERE, "content", lang)
for fn in sorted(os.listdir(folder)):
if fn.endswith(".html"):
meta, body = parse(read("content", lang, fn), f"content/{lang}/{fn}")
for key in ("id", "path", "nav", "title", "description"):
if key not in meta:
fail(f"content/{lang}/{fn}: front matter lacks '{key}'")
if meta["nav"] not in NAV:
fail(f"content/{lang}/{fn}: unknown nav '{meta['nav']}'")
pages.append(dict(meta, lang=lang, kind="page", body=body, src=f"content/{lang}/{fn}"))
news_dir = os.path.join(folder, "news")
if os.path.isdir(news_dir):
prefix = "" if lang == "en" else "/it"
for fn in sorted(os.listdir(news_dir)):
if not fn.endswith(".md"):
continue
m = POST_NAME.match(fn[:-3])
if not m:
fail(f"content/{lang}/news/{fn}: name must be YYYY-MM-DD-slug.md")
src = f"content/{lang}/news/{fn}"
meta, body = parse(read("content", lang, "news", fn), src)
if "title" not in meta:
fail(f"{src}: front matter lacks 'title'")
if "—" in body or "—" in meta["title"]:
fail(f"{src}: no em dashes, please")
pages.append(dict(meta, lang=lang, kind="post", id="news/" + fn[:-3], date=m.group(1), nav="news",
path=f"{prefix}/news/{m.group(2)}.html", body=body, src=src,
description=meta.get("summary", meta["title"])))
return pages
def people_page(t):
cards = []
for handle, name, en, it, links in PEOPLE:
bio = en if t["lang"] == "en" else it
title = html.escape(name) + " (" + html.escape(handle) + ")" if name else html.escape(handle)
li = "\n".join(f'<li><a href="{u}">{html.escape(l)}</a></li>' for l, u in links)
cards.append(f"""<h2 id="{html.escape(handle)}">{title}</h2>
def build():
css = read("static", "style.css").strip("\n")
tpl = {n[:-5]: read("templates", n) for n in os.listdir(os.path.join(HERE, "templates")) if n.endswith(".html")}
site = toml("content", "site.toml")
site["contact_shown"] = site["contact"].replace("@", " (at) ") # no mailto link, against address harvesters
strings = {lang: toml("content", lang, "lang.toml") for lang in LANGS}
pages = {lang: load_pages(lang) for lang in LANGS}
by_id = {(p["id"], p["lang"]): p for lang in LANGS for p in pages[lang]}
<p>
{html.escape(bio)}
</p>
# Manifesto: the user's own Markdown files, rendered once per language.
manifesto = {}
for lang in LANGS:
title, toc, body = md_to_html(no_em_dash(read(f"MANIFESTO.{lang}.md")))
manifesto[lang] = dict(
manifesto_title=html.escape(title),
manifesto_toc="\n".join(f'<li><a href="#{sl}">{inline(h)}</a></li>' for sl, h in toc),
manifesto_body=body)
<ul>
{li}
</ul>
""")
body = f"""{nav(t, t['other_ppl'], 'ppl')}
def news_lists(lang):
posts = sorted((p for p in pages[lang] if p["kind"] == "post"), key=lambda p: p["date"], reverse=True)
<h1>{t['people_h']}</h1>
def li(p):
line = f'<li><time datetime="{p["date"]}">{p["date"]}</time> <a href="{p["path"]}">{html.escape(p["title"], quote=False)}</a>'
if p.get("summary"):
line += ": " + html.escape(p["summary"], quote=False)
return line + "</li>"
items = "\n".join(li(p) for p in posts)
full = f"<ul>\n{items}\n</ul>" if posts else f"<p>\n{strings[lang]['news_empty']}\n</p>"
return full, items, posts[:NEWS_ON_HOME]
<p>
{t['people_p']}
</p>
news = {lang: news_lists(lang) for lang in LANGS}
{"".join(cards)}
<footer>
<p>
<a href="{t['home_link']}">{t['back']}</a>
</p>
<p>
{t['nojs']}
</p>
{badges("https://kmalloc.org" + t["ppl"])}
</footer>"""
return page(t, t["people_title"], t["people_desc"], body, t["other_ppl"], t["ppl"])
for lang in LANGS:
other = "it" if lang == "en" else "en"
st = strings[lang]
for p in pages[lang]:
name = p["src"]
alt = by_id.get((p["id"], other))
ctx = dict(site, **st, **manifesto[lang])
page_title = p["title"] if p["kind"] == "page" else "kmalloc.org: " + p["title"]
ctx.update(css=css, title=p["title"], description=p["description"], path=p["path"],
title_html=html.escape(page_title), post_title=html.escape(p["title"]), description_attr=html.escape(p["description"], quote=True),
doc_url=site["base_url"] + p["path"], date=p.get("date", ""))
for k in NAV:
ctx["cur_" + k] = ' aria-current="page"' if p["nav"] == k else ""
ctx["alt_url"] = alt["path"] if alt else ""
ctx["alt_switch"] = p.get("switch") or (alt["path"] if alt else strings[other]["url_news"])
ctx["alt_links"] = (f'<link rel="alternate" hreflang="{other}" href="{alt["path"]}">\n'
f'<link rel="alternate" hreflang="{lang}" href="{p["path"]}">') if alt else ""
full, items, latest = news[lang]
ctx["news_list"] = full
ctx["latest_news"] = render(tpl["latest-news"], dict(ctx, news_items="\n".join(
f'<li><time datetime="{x["date"]}">{x["date"]}</time> <a href="{x["path"]}">{html.escape(x["title"], quote=False)}</a></li>'
for x in latest)), "templates/latest-news.html") if latest else ""
if p["kind"] == "post":
_, _, post_html = md_to_html(p["body"])
ctx["post_body"] = post_html
ctx["content"] = render(tpl["news-post"], ctx, "templates/news-post.html")
lead = "news"
else:
ctx["content"] = render(p["body"].strip("\n") + "\n", ctx, name)
lead = p.get("lead", "back")
ctx["lead"] = render(tpl["lead-" + lead], ctx, f"templates/lead-{lead}.html")
ctx["badges"] = render(tpl["badges"], dict(ctx, doc_q=ctx["doc_url"].replace(":", "%3A").replace("/", "%2F")),
"templates/badges.html")
ctx["header"] = render(tpl["header"], ctx, "templates/header.html")
ctx["footer"] = render(tpl["footer"], ctx, "templates/footer.html")
rel = p["path"].lstrip("/")
write(rel + "index.html" if rel == "" or rel.endswith("/") else rel, render(tpl["base"], ctx, "templates/base.html"))
for dest, src in ASSETS.items():
target = os.path.join(OUT, dest)
os.makedirs(os.path.dirname(target), exist_ok=True)
shutil.copy(os.path.join(HERE, src), target)
write("robots.txt", "User-agent: *\nDisallow: /\n")
count = sum(len(v) for v in pages.values())
print(f"built {count} pages into {OUT}")
def services_page(t):
en = t["lang"] == "en"
secs = []
for sid, name, url, d_en, d_it in SERVICE_PAGES:
secs.append(f"""<h2 id="{sid}">{html.escape(name)}</h2>
<p>
{html.escape(d_en if en else d_it)}
<a href="{url}">{t['open_a']}</a>.
</p>
""")
body = f"""{nav(t, t['other_svc'], 'svc')}
<h1>{t['services_h']}</h1>
<p>
{html.escape(t['svc_intro'])}
</p>
<h2 id="account">{t['free_h']}</h2>
<p>
{t['free_p1']}
<strong>{CONTACT_SHOWN}</strong>
({t['at_hint']}),
{t['free_p2']}
</p>
{"".join(secs)}
<h2 id="donate">{t['donate_h']}</h2>
<p>
{t['donate_p']}
<a href="bitcoin:{BTC}"><code>{BTC}</code></a>
</p>
<h2 id="terms">{t['terms_h']}</h2>
<p>
{html.escape(t['terms_p'])}
</p>
<footer>
<p>
<a href="{t['home_link']}">{t['back']}</a>
</p>
<p>
{t['nojs']}
</p>
{badges("https://kmalloc.org" + t["svc"])}
</footer>"""
return page(t, t["svc_title"], t["svc_desc"], body, t["other_svc"], t["svc"])
os.makedirs(os.path.join(OUT, "it"), exist_ok=True)
os.makedirs(os.path.join(OUT, "fonts"), exist_ok=True)
import shutil
os.makedirs(os.path.join(OUT, "badges"), exist_ok=True)
for b in ("w3c-html5.png", "w3c-css.png"):
shutil.copy(os.path.join(HERE, "badges", b), os.path.join(OUT, "badges", b))
shutil.copy(os.path.join(HERE, "fonts", "terminess.woff2"), os.path.join(OUT, "fonts", "terminess.woff2"))
for lang, prefix in (("en", ""), ("it", "it/")):
t = T[lang]
open(os.path.join(OUT, prefix + "index.html"), "w", encoding="utf-8").write(home(t))
open(os.path.join(OUT, prefix + "manifesto.html"), "w", encoding="utf-8").write(manifesto(t))
open(os.path.join(OUT, prefix + ("people.html" if lang == "en" else "persone.html")), "w", encoding="utf-8").write(people_page(t))
open(os.path.join(OUT, prefix + ("services.html" if lang == "en" else "servizi.html")), "w", encoding="utf-8").write(services_page(t))
open(os.path.join(OUT, "robots.txt"), "w", encoding="utf-8").write("User-agent: *\nDisallow: /\n")
print("built:", sorted(os.listdir(OUT)), sorted(os.listdir(os.path.join(OUT, "it"))))
build()

58
content/en/index.html Normal file
View file

@ -0,0 +1,58 @@
---
id: home
path: /
nav: home
lead: home
title: kmalloc.org: Technology. Freedom. Dissent.
description: kmalloc.org is an independent hacker space that promotes free software, privacy and an open Internet.
---
<p>
<img class="logo" src="/logo-auto.svg" alt="kmalloc" width="112">
</p>
<h1 class="hero">Technology.<br>Freedom.<br>Dissent.</h1>
<p>
<strong>kmalloc.org is a hacker, antifascist, ethical space.</strong>
</p>
<p>
kmalloc.org is an independent hacker space that promotes free software, privacy and an open Internet, defending freedom of thought, the dignity of work and the right of people not to be controlled, exploited or subordinated to arbitrary powers.
</p>
<p>
<strong>Allocate freedom.</strong>
</p>
<h2 id="manifesto">Manifesto</h2>
<p>
What we believe, in twelve points and a few commitments:
<a href="{{url_manifesto}}">read the manifesto</a> (version {{manifesto_version}}).
</p>
<h2 id="people">People</h2>
<p>
Who is behind kmalloc.org:
<a href="{{url_people}}">meet the people</a>.
</p>
<h2 id="services">Services</h2>
<p>
Run on our own server, with free software. Accounts are created by hand.
<a href="{{url_services}}">get an account</a>.
</p>
<ul>
<li><a href="https://git.kmalloc.org/">git</a>: code hosting (Forgejo)</li>
<li><a href="https://social.kmalloc.org/@squid">social</a>: Mastodon, accounts on approval</li>
<li><a href="https://lists.kmalloc.org/">lists</a>: mailing lists (Mailman 3)</li>
<li><a href="https://chat.kmalloc.org/">chat</a>: XMPP, web client</li>
<li><a href="https://element.kmalloc.org/">matrix</a>: Matrix, Element web client</li>
<li><a href="https://meet.kmalloc.org/">meet</a>: video conferences (Jitsi Meet)</li>
<li><a href="https://webmail.kmalloc.org/">webmail</a>: email on our own server</li>
</ul>
{{latest_news}}

21
content/en/lang.toml Normal file
View file

@ -0,0 +1,21 @@
# Chrome strings, en.
lang = "en"
other = "it"
other_name = "Italiano"
home_link = "/?lang=en"
url_manifesto = "/manifesto.html"
url_people = "/people.html"
url_services = "/services.html"
url_news = "/news/"
nav_manifesto = "Manifesto"
nav_people = "People"
nav_services = "Services"
nav_news = "News"
sections = "Sections"
nojs = "This page uses no JavaScript, cookies or trackers."
back = "home"
version = "Version"
toc = "Contents"
news_p = "Updates from kmalloc.org."
news_all = "all news"
news_empty = "No news yet."

20
content/en/manifesto.html Normal file
View file

@ -0,0 +1,20 @@
---
id: manifesto
path: /manifesto.html
nav: manifesto
title: kmalloc.org: Manifesto
description: The kmalloc.org manifesto: free software, privacy, an open Internet, dignity at work.
---
<h1>{{manifesto_title}}</h1>
<p>
<strong>{{version}} {{manifesto_version}}</strong>
</p>
<h2>{{toc}}</h2>
<ul>
{{manifesto_toc}}
</ul>
{{manifesto_body}}

14
content/en/news.html Normal file
View file

@ -0,0 +1,14 @@
---
id: news
path: /news/
nav: news
title: kmalloc.org: News
description: Updates from kmalloc.org.
---
<h1>News</h1>
<p>
Updates from kmalloc.org.
</p>
{{news_list}}

0
content/en/news/.gitkeep Normal file
View file

23
content/en/people.html Normal file
View file

@ -0,0 +1,23 @@
---
id: people
path: /people.html
nav: people
title: kmalloc.org: People
description: The people behind kmalloc.org.
---
<h1>People</h1>
<p>
Who is behind kmalloc.org.
</p>
<h2 id="squid">squid</h2>
<p>
I'm squid. I run kmalloc.org, write code and maintain the services on this site. I have been into computers since I was ten, when I got an IBM PS/2 with a 486DX and played Gorilla, a QBasic game: ever since, I have been taking things apart to understand how they work. Outside of work: retro computing, science fiction and extreme metal.
</p>
<ul>
<li><a href="https://social.kmalloc.org/@squid">Mastodon</a></li>
<li><a href="https://git.kmalloc.org/squid">git</a></li>
</ul>

83
content/en/services.html Normal file
View file

@ -0,0 +1,83 @@
---
id: services
path: /services.html
nav: services
title: kmalloc.org: Services
description: The services run by kmalloc.org: email, git, Mastodon, XMPP, Matrix, mailing lists and video conferences. Free, by request.
---
<h1>Services</h1>
<p>
These services run on our own server, with free software, for people who want an alternative to the big platforms.
</p>
<h2 id="account">Get an account</h2>
<p>
The services are free of charge. To ask for an account, write to
<strong>{{contact_shown}}</strong>
(replace (at) with @),
telling us which services you want and the username you would like.
</p>
<h2 id="mail">Email</h2>
<p>
An address @kmalloc.org on our own mail server, with webmail and support for any standard mail client. IMAP: mail.kmalloc.org, port 993 (TLS). SMTP submission: mail.kmalloc.org, port 465 (TLS). Outgoing mail is signed with DKIM and protected by SPF and DMARC.
<a href="https://webmail.kmalloc.org/">open</a>.
</p>
<h2 id="lists">Mailing lists</h2>
<p>
Mailing lists with web archives (Mailman 3). Lists live under @lists.kmalloc.org. If you need one, ask.
<a href="https://lists.kmalloc.org/">open</a>.
</p>
<h2 id="git">Git</h2>
<p>
Code hosting with Forgejo: repositories, issues and pull requests. Git over SSH uses port 2222. Reading public repositories needs no account.
<a href="https://git.kmalloc.org/">open</a>.
</p>
<h2 id="social">Mastodon</h2>
<p>
A Mastodon server. Your address is @name@social.kmalloc.org. You can ask for an account on the site itself: requests are approved by hand.
<a href="https://social.kmalloc.org/">open</a>.
</p>
<h2 id="chat">XMPP chat</h2>
<p>
Instant messaging with XMPP: address name@kmalloc.org, group rooms on conference.kmalloc.org, file sharing, and audio and video calls through our own TURN server. Use the web client or any XMPP app (server kmalloc.org, port 5222).
<a href="https://chat.kmalloc.org/">open</a>.
</p>
<h2 id="matrix">Matrix</h2>
<p>
A Matrix homeserver: address @name:kmalloc.org. Use the Element web client or any Matrix app with homeserver matrix.kmalloc.org.
<a href="https://element.kmalloc.org/">open</a>.
</p>
<h2 id="meet">Video conferences</h2>
<p>
Video conferences with Jitsi Meet. Anyone with the link can join a room; creating a room needs an account.
<a href="https://meet.kmalloc.org/">open</a>.
</p>
<h2 id="donate">Support kmalloc.org</h2>
<p>
Donations are welcome and help keep the server running. Bitcoin address:
<a href="bitcoin:{{btc}}"><code>{{btc}}</code></a>
</p>
<h2 id="terms">Good to know</h2>
<p>
Everything is run by one person on one server, with nightly encrypted backups and no guarantees of availability. Be respectful: the manifesto explains what we stand for.
</p>

59
content/it/index.html Normal file
View file

@ -0,0 +1,59 @@
---
id: home
path: /it/
nav: home
lead: home
title: kmalloc.org: Technology. Freedom. Dissent.
description: kmalloc.org è uno spazio hacker indipendente che promuove il software libero, la privacy e un Internet aperto.
switch: /?lang=en
---
<p>
<img class="logo" src="/logo-auto.svg" alt="kmalloc" width="112">
</p>
<h1 class="hero">Technology.<br>Freedom.<br>Dissent.</h1>
<p>
<strong>kmalloc.org è uno spazio hacker, antifascista, etico.</strong>
</p>
<p>
kmalloc.org è uno spazio hacker indipendente che promuove il software libero, la privacy e un Internet aperto, difendendo la libertà di pensiero, la dignità del lavoro e il diritto delle persone a non essere controllate, sfruttate o subordinate a poteri arbitrari.
</p>
<p>
<strong>Allocate freedom.</strong>
</p>
<h2 id="manifesto">Manifesto</h2>
<p>
Quello in cui crediamo, in dodici punti e qualche impegno:
<a href="{{url_manifesto}}">leggi il manifesto</a> (versione {{manifesto_version}}).
</p>
<h2 id="people">Persone</h2>
<p>
Chi c'è dietro kmalloc.org:
<a href="{{url_people}}">conosci le persone</a>.
</p>
<h2 id="services">Servizi</h2>
<p>
Girano sul nostro server, con software libero. Gli account si creano a mano.
<a href="{{url_services}}">richiedi un account</a>.
</p>
<ul>
<li><a href="https://git.kmalloc.org/">git</a>: repository di codice (Forgejo)</li>
<li><a href="https://social.kmalloc.org/@squid">social</a>: Mastodon, account su approvazione</li>
<li><a href="https://lists.kmalloc.org/">lists</a>: liste di posta (Mailman 3)</li>
<li><a href="https://chat.kmalloc.org/">chat</a>: XMPP, client web</li>
<li><a href="https://element.kmalloc.org/">matrix</a>: Matrix, client web Element</li>
<li><a href="https://meet.kmalloc.org/">meet</a>: videoconferenze (Jitsi Meet)</li>
<li><a href="https://webmail.kmalloc.org/">webmail</a>: posta sul nostro server</li>
</ul>
{{latest_news}}

21
content/it/lang.toml Normal file
View file

@ -0,0 +1,21 @@
# Chrome strings, it.
lang = "it"
other = "en"
other_name = "English"
home_link = "/it/"
url_manifesto = "/it/manifesto.html"
url_people = "/it/persone.html"
url_services = "/it/servizi.html"
url_news = "/it/news/"
nav_manifesto = "Manifesto"
nav_people = "Persone"
nav_services = "Servizi"
nav_news = "News"
sections = "Sezioni"
nojs = "Questa pagina non usa JavaScript, cookie né tracker."
back = "home"
version = "Versione"
toc = "Indice"
news_p = "Novità da kmalloc.org."
news_all = "tutte le news"
news_empty = "Ancora nessuna news."

20
content/it/manifesto.html Normal file
View file

@ -0,0 +1,20 @@
---
id: manifesto
path: /it/manifesto.html
nav: manifesto
title: kmalloc.org: Manifesto
description: Il manifesto di kmalloc.org: software libero, privacy, un Internet aperto, dignità nel lavoro.
---
<h1>{{manifesto_title}}</h1>
<p>
<strong>{{version}} {{manifesto_version}}</strong>
</p>
<h2>{{toc}}</h2>
<ul>
{{manifesto_toc}}
</ul>
{{manifesto_body}}

14
content/it/news.html Normal file
View file

@ -0,0 +1,14 @@
---
id: news
path: /it/news/
nav: news
title: kmalloc.org: News
description: Novità da kmalloc.org.
---
<h1>News</h1>
<p>
Novità da kmalloc.org.
</p>
{{news_list}}

0
content/it/news/.gitkeep Normal file
View file

23
content/it/persone.html Normal file
View file

@ -0,0 +1,23 @@
---
id: people
path: /it/persone.html
nav: people
title: kmalloc.org: Persone
description: Le persone dietro kmalloc.org.
---
<h1>Persone</h1>
<p>
Chi c'è dietro kmalloc.org.
</p>
<h2 id="squid">squid</h2>
<p>
Sono squid. Gestisco kmalloc.org, scrivo codice e mantengo i servizi di questo sito. Mi appassionano i computer da quando, a dieci anni, ebbi un IBM PS/2 con un 486DX e giocai a Gorilla, un gioco in QBasic: da allora smonto le cose per capire come funzionano. Fuori dal lavoro: retrocomputing, fantascienza ed extreme metal.
</p>
<ul>
<li><a href="https://social.kmalloc.org/@squid">Mastodon</a></li>
<li><a href="https://git.kmalloc.org/squid">git</a></li>
</ul>

83
content/it/servizi.html Normal file
View file

@ -0,0 +1,83 @@
---
id: services
path: /it/servizi.html
nav: services
title: kmalloc.org: Servizi
description: I servizi di kmalloc.org: posta, git, Mastodon, XMPP, Matrix, liste di posta e videoconferenze. Gratuiti, su richiesta.
---
<h1>Servizi</h1>
<p>
Questi servizi girano sul nostro server, con software libero, per chi vuole un'alternativa alle grandi piattaforme.
</p>
<h2 id="account">Richiedi un account</h2>
<p>
I servizi sono gratuiti. Per chiedere un account scrivi a
<strong>{{contact_shown}}</strong>
(sostituisci (at) con @),
indicando quali servizi vuoi e il nome utente che preferisci.
</p>
<h2 id="mail">Email</h2>
<p>
Un indirizzo @kmalloc.org sul nostro server di posta, con webmail e supporto per qualsiasi client di posta standard. IMAP: mail.kmalloc.org, porta 993 (TLS). Invio SMTP: mail.kmalloc.org, porta 465 (TLS). La posta in uscita è firmata con DKIM e protetta da SPF e DMARC.
<a href="https://webmail.kmalloc.org/">apri</a>.
</p>
<h2 id="lists">Mailing lists</h2>
<p>
Liste di posta con archivi consultabili sul web (Mailman 3). Le liste stanno sotto @lists.kmalloc.org. Se te ne serve una, chiedila.
<a href="https://lists.kmalloc.org/">apri</a>.
</p>
<h2 id="git">Git</h2>
<p>
Hosting di codice con Forgejo: repository, issue e pull request. Git via SSH usa la porta 2222. Per leggere i repository pubblici non serve un account.
<a href="https://git.kmalloc.org/">apri</a>.
</p>
<h2 id="social">Mastodon</h2>
<p>
Un server Mastodon. Il tuo indirizzo è @nome@social.kmalloc.org. L'account si può chiedere direttamente sul sito: le richieste si approvano a mano.
<a href="https://social.kmalloc.org/">apri</a>.
</p>
<h2 id="chat">XMPP chat</h2>
<p>
Messaggistica con XMPP: indirizzo nome@kmalloc.org, stanze di gruppo su conference.kmalloc.org, condivisione di file e chiamate audio e video con un nostro server TURN. Usa il client web o qualsiasi app XMPP (server kmalloc.org, porta 5222).
<a href="https://chat.kmalloc.org/">apri</a>.
</p>
<h2 id="matrix">Matrix</h2>
<p>
Un homeserver Matrix: indirizzo @nome:kmalloc.org. Usa il client web Element o qualsiasi app Matrix con homeserver matrix.kmalloc.org.
<a href="https://element.kmalloc.org/">apri</a>.
</p>
<h2 id="meet">Video conferences</h2>
<p>
Videoconferenze con Jitsi Meet. Chiunque abbia il link può entrare in una stanza; per crearne una serve un account.
<a href="https://meet.kmalloc.org/">apri</a>.
</p>
<h2 id="donate">Sostieni kmalloc.org</h2>
<p>
Le donazioni sono benvenute e aiutano a tenere acceso il server. Indirizzo Bitcoin:
<a href="bitcoin:{{btc}}"><code>{{btc}}</code></a>
</p>
<h2 id="terms">Da sapere</h2>
<p>
Tutto è gestito da una persona su un solo server, con backup notturni cifrati e nessuna garanzia di disponibilità. Siate rispettosi: il manifesto spiega in cosa crediamo.
</p>

5
content/site.toml Normal file
View file

@ -0,0 +1,5 @@
# Values shared by every page.
base_url = "https://kmalloc.org"
manifesto_version = "1.0"
contact = "squid@kmalloc.org"
btc = "bc1qsj5qadrzlqmfwcru4fwuqvftg833te5f9mja2c"

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
logo/web/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

129
static/style.css Normal file
View file

@ -0,0 +1,129 @@
@font-face {
font-family: "Terminess";
src: url("/fonts/terminess.woff2") format("woff2");
font-display: swap;
}
:root {
--bg: #F9F7ED;
--surface: #F1EDE0;
--border: #D9D3C2;
--text: #111417;
--muted: #5b564a;
--accent: #D9480F;
--link: #b13a0b;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #111417;
--surface: #1b1f23;
--border: #5b564a;
--text: #F9F7ED;
--muted: #8a8473;
--link: #f0683a;
}
}
body {
margin: 0 auto;
max-width: 40em;
padding: 1em;
background-color: var(--bg);
color: var(--text);
font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
line-height: 1.6;
}
h1, h2, h3 {
margin: 2em 0 .5em;
font-family: "Terminess", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
font-weight: normal;
line-height: 1.25;
}
a {
color: var(--link);
}
a:visited {
color: var(--muted);
}
a:hover, header a[aria-current] {
color: var(--text);
}
a:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
header {
border-bottom: 1px solid var(--border);
line-height: 2;
}
header a[aria-current] {
text-decoration: none;
}
footer {
margin-top: 3em;
border-top: 1px solid var(--border);
color: var(--muted);
font-size: .875em;
}
blockquote {
margin: 1.5em 0;
padding: 0 1em;
border-left: 4px solid var(--accent);
}
code {
background-color: var(--surface);
color: var(--text);
font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
font-size: .9375em;
overflow-wrap: anywhere;
}
.hero {
margin: .5em 0 .4em;
font-size: 3em;
line-height: 1.1;
}
@media (max-width: 30em) {
.hero {
font-size: 2em;
}
}
.logo {
width: 7em;
height: auto;
}
@media print {
:root {
--bg: #fff;
--border: #000;
--text: #000;
--muted: #000;
--link: #000;
}
header, .badges {
display: none;
}
a[href^="http"]::after {
content: " <" attr(href) ">";
}
h1, h2, h3 {
page-break-after: avoid;
}
}

Some files were not shown because too many files have changed in this diff Show more