diff --git a/README.md b/README.md index 3b2eb19..5df8087 100644 --- a/README.md +++ b/README.md @@ -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 `. +## 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.toml` holds the chrome strings of one language (`en`, `it`). +- `content//*.html` are the pages: a front matter block, then an HTML fragment. +- `content//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. + --- +

People

+ +`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//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. diff --git a/build.py b/build.py index 1fdb012..4661e3a 100644 --- a/build.py +++ b/build.py @@ -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 (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.toml the chrome strings of one language + content//*.html pages: front matter, then an HTML fragment + content//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"""

-Valid HTML5 -Valid CSS -

""" +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"""
- -
""" +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""" - - - - - - - - - - - - - -{html.escape(title)} - - -{body} - - -""" -def home(t): - li = "\n".join( - f'
  • {n}: {html.escape(t["lang"] == "en" and en or it)}
  • ' - 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) -

    - -

    -

    Technology.
    Freedom.
    Dissent.

    +def toml(*parts): + with open(os.path.join(HERE, *parts), "rb") as f: + return tomllib.load(f) -

    -{html.escape(t['identity'])} -

    -

    -{html.escape(t['intro'])} -

    +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) -

    -Allocate freedom. -

    -

    {t['manifesto_h']}

    +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) -

    -{t['manifesto_p']} -{t['manifesto_a']} ({t['version'].lower()} {MANIFESTO_VERSION}). -

    - -

    {t['people_h']}

    - -

    -{t['people_p'].rstrip('.')}: -{t['people_a']}. -

    - -

    {t['services_h']}

    - -

    -{t['services_p']} -{t['free_h'].lower()}. -

    - -
      -{li} -
    - -
    -

    -Free Your Mind… and Your Ass Will Follow. -

    -

    -{t['nojs']} -

    -{badges("https://kmalloc.org" + t["home"])} -
    """ - 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"\1", s) + s = re.sub(r"\[([^\]]+)\]\(([^)\s]+)\)", r'\1', s) s = re.sub(r"\*\*(.+?)\*\*", r"\1", s) s = re.sub(r"(?\1", 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("

    \n" + "\n".join(para) + "\n

    \n"); para = [] + out.append("

    \n" + "\n".join(para) + "\n

    \n") + para = [] if quote: - out.append("
    \n

    \n" + "\n".join(quote) + "\n

    \n
    \n"); quote = [] + out.append("
    \n

    \n" + "\n".join(quote) + "\n

    \n
    \n") + quote = [] if items: - out.append("
      \n" + "\n".join(f"
    • {i}
    • " for i in items) + "\n
    \n"); items = [] + out.append("
      \n" + "\n".join(f"
    • {i}
    • " for i in items) + "\n
    \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'

    {inline(h)}

    \n'); continue + flush() + h = s[3:] + sl = slug(h) + toc.append((sl, h)) + out.append(f'

    {inline(h)}

    \n') + continue if s.startswith("> "): - if para or items: flush() - quote.append(inline(s[2:]) + ("
    " if br else "")); continue + if para or items: + flush() + quote.append(inline(s[2:]) + ("
    " 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'
  • {inline(h)}
  • ' for sl, h in toc) - body = f"""{nav(t, t['other_man'], 'man')} -

    {html.escape(title)}

    +# ---------------------------------------------------------------- site model -

    -{t['version']} {MANIFESTO_VERSION} -

    - -

    {t['toc']}

    - -
      -{toc_html} -
    - -{body_html} -
    -

    -{t['back']} -

    -

    -{t['nojs']} -

    -{badges("https://kmalloc.org" + t["man"])} -
    """ - 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//*.html and posts from content//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'
  • {html.escape(l)}
  • ' for l, u in links) - cards.append(f"""

    {title}

    +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]} -

    -{html.escape(bio)} -

    + # 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'
  • {inline(h)}
  • ' for sl, h in toc), + manifesto_body=body) -
      -{li} -
    -""") - 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) -

    {t['people_h']}

    + def li(p): + line = f'
  • {html.escape(p["title"], quote=False)}' + if p.get("summary"): + line += ": " + html.escape(p["summary"], quote=False) + return line + "
  • " + items = "\n".join(li(p) for p in posts) + full = f"
      \n{items}\n
    " if posts else f"

    \n{strings[lang]['news_empty']}\n

    " + return full, items, posts[:NEWS_ON_HOME] -

    -{t['people_p']} -

    + news = {lang: news_lists(lang) for lang in LANGS} -{"".join(cards)} -
    -

    -{t['back']} -

    -

    -{t['nojs']} -

    -{badges("https://kmalloc.org" + t["ppl"])} -
    """ - 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'\n' + f'') 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'
  • {html.escape(x["title"], quote=False)}
  • ' + 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"""

    {html.escape(name)}

    - -

    -{html.escape(d_en if en else d_it)} -{t['open_a']}. -

    -""") - body = f"""{nav(t, t['other_svc'], 'svc')} - -

    {t['services_h']}

    - -

    -{html.escape(t['svc_intro'])} -

    - -

    {t['free_h']}

    - -

    -{t['free_p1']} -{CONTACT_SHOWN} -({t['at_hint']}), -{t['free_p2']} -

    - -{"".join(secs)} - - -

    -{t['donate_p']} -{BTC} -

    - -

    {t['terms_h']}

    - -

    -{html.escape(t['terms_p'])} -

    - -
    -

    -{t['back']} -

    -

    -{t['nojs']} -

    -{badges("https://kmalloc.org" + t["svc"])} -
    """ - 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() diff --git a/content/en/index.html b/content/en/index.html new file mode 100644 index 0000000..36466f4 --- /dev/null +++ b/content/en/index.html @@ -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. +--- +

    + +

    + +

    Technology.
    Freedom.
    Dissent.

    + +

    +kmalloc.org is a hacker, antifascist, ethical space. +

    + +

    +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. +

    + +

    +Allocate freedom. +

    + +

    Manifesto

    + +

    +What we believe, in twelve points and a few commitments: +read the manifesto (version {{manifesto_version}}). +

    + +

    People

    + +

    +Who is behind kmalloc.org: +meet the people. +

    + +

    Services

    + +

    +Run on our own server, with free software. Accounts are created by hand. +get an account. +

    + +
      +
    • git: code hosting (Forgejo)
    • +
    • social: Mastodon, accounts on approval
    • +
    • lists: mailing lists (Mailman 3)
    • +
    • chat: XMPP, web client
    • +
    • matrix: Matrix, Element web client
    • +
    • meet: video conferences (Jitsi Meet)
    • +
    • webmail: email on our own server
    • +
    + +{{latest_news}} diff --git a/content/en/lang.toml b/content/en/lang.toml new file mode 100644 index 0000000..259c262 --- /dev/null +++ b/content/en/lang.toml @@ -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." diff --git a/content/en/manifesto.html b/content/en/manifesto.html new file mode 100644 index 0000000..67354bb --- /dev/null +++ b/content/en/manifesto.html @@ -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. +--- +

    {{manifesto_title}}

    + +

    +{{version}} {{manifesto_version}} +

    + +

    {{toc}}

    + +
      +{{manifesto_toc}} +
    + +{{manifesto_body}} \ No newline at end of file diff --git a/content/en/news.html b/content/en/news.html new file mode 100644 index 0000000..db62c33 --- /dev/null +++ b/content/en/news.html @@ -0,0 +1,14 @@ +--- +id: news +path: /news/ +nav: news +title: kmalloc.org: News +description: Updates from kmalloc.org. +--- +

    News

    + +

    +Updates from kmalloc.org. +

    + +{{news_list}} diff --git a/content/en/news/.gitkeep b/content/en/news/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/content/en/people.html b/content/en/people.html new file mode 100644 index 0000000..5b8997a --- /dev/null +++ b/content/en/people.html @@ -0,0 +1,23 @@ +--- +id: people +path: /people.html +nav: people +title: kmalloc.org: People +description: The people behind kmalloc.org. +--- +

    People

    + +

    +Who is behind kmalloc.org. +

    + +

    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. +

    + + diff --git a/content/en/services.html b/content/en/services.html new file mode 100644 index 0000000..d76559c --- /dev/null +++ b/content/en/services.html @@ -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. +--- +

    Services

    + +

    +These services run on our own server, with free software, for people who want an alternative to the big platforms. +

    + +

    Get an account

    + +

    +The services are free of charge. To ask for an account, write to +{{contact_shown}} +(replace (at) with @), +telling us which services you want and the username you would like. +

    + +

    Email

    + +

    +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. +open. +

    + +

    Mailing lists

    + +

    +Mailing lists with web archives (Mailman 3). Lists live under @lists.kmalloc.org. If you need one, ask. +open. +

    + +

    Git

    + +

    +Code hosting with Forgejo: repositories, issues and pull requests. Git over SSH uses port 2222. Reading public repositories needs no account. +open. +

    + +

    Mastodon

    + +

    +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. +open. +

    + +

    XMPP chat

    + +

    +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). +open. +

    + +

    Matrix

    + +

    +A Matrix homeserver: address @name:kmalloc.org. Use the Element web client or any Matrix app with homeserver matrix.kmalloc.org. +open. +

    + +

    Video conferences

    + +

    +Video conferences with Jitsi Meet. Anyone with the link can join a room; creating a room needs an account. +open. +

    + + + +

    +Donations are welcome and help keep the server running. Bitcoin address: +{{btc}} +

    + +

    Good to know

    + +

    +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. +

    diff --git a/content/it/index.html b/content/it/index.html new file mode 100644 index 0000000..991c262 --- /dev/null +++ b/content/it/index.html @@ -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 +--- +

    + +

    + +

    Technology.
    Freedom.
    Dissent.

    + +

    +kmalloc.org è uno spazio hacker, antifascista, etico. +

    + +

    +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. +

    + +

    +Allocate freedom. +

    + +

    Manifesto

    + +

    +Quello in cui crediamo, in dodici punti e qualche impegno: +leggi il manifesto (versione {{manifesto_version}}). +

    + +

    Persone

    + +

    +Chi c'è dietro kmalloc.org: +conosci le persone. +

    + +

    Servizi

    + +

    +Girano sul nostro server, con software libero. Gli account si creano a mano. +richiedi un account. +

    + +
      +
    • git: repository di codice (Forgejo)
    • +
    • social: Mastodon, account su approvazione
    • +
    • lists: liste di posta (Mailman 3)
    • +
    • chat: XMPP, client web
    • +
    • matrix: Matrix, client web Element
    • +
    • meet: videoconferenze (Jitsi Meet)
    • +
    • webmail: posta sul nostro server
    • +
    + +{{latest_news}} diff --git a/content/it/lang.toml b/content/it/lang.toml new file mode 100644 index 0000000..874831e --- /dev/null +++ b/content/it/lang.toml @@ -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." diff --git a/content/it/manifesto.html b/content/it/manifesto.html new file mode 100644 index 0000000..c4f7aee --- /dev/null +++ b/content/it/manifesto.html @@ -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. +--- +

    {{manifesto_title}}

    + +

    +{{version}} {{manifesto_version}} +

    + +

    {{toc}}

    + +
      +{{manifesto_toc}} +
    + +{{manifesto_body}} \ No newline at end of file diff --git a/content/it/news.html b/content/it/news.html new file mode 100644 index 0000000..1c5a41e --- /dev/null +++ b/content/it/news.html @@ -0,0 +1,14 @@ +--- +id: news +path: /it/news/ +nav: news +title: kmalloc.org: News +description: Novità da kmalloc.org. +--- +

    News

    + +

    +Novità da kmalloc.org. +

    + +{{news_list}} diff --git a/content/it/news/.gitkeep b/content/it/news/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/content/it/persone.html b/content/it/persone.html new file mode 100644 index 0000000..ed185e1 --- /dev/null +++ b/content/it/persone.html @@ -0,0 +1,23 @@ +--- +id: people +path: /it/persone.html +nav: people +title: kmalloc.org: Persone +description: Le persone dietro kmalloc.org. +--- +

    Persone

    + +

    +Chi c'è dietro kmalloc.org. +

    + +

    squid

    + +

    +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. +

    + + diff --git a/content/it/servizi.html b/content/it/servizi.html new file mode 100644 index 0000000..4caa239 --- /dev/null +++ b/content/it/servizi.html @@ -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. +--- +

    Servizi

    + +

    +Questi servizi girano sul nostro server, con software libero, per chi vuole un'alternativa alle grandi piattaforme. +

    + +

    Richiedi un account

    + +

    +I servizi sono gratuiti. Per chiedere un account scrivi a +{{contact_shown}} +(sostituisci (at) con @), +indicando quali servizi vuoi e il nome utente che preferisci. +

    + +

    Email

    + +

    +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. +apri. +

    + +

    Mailing lists

    + +

    +Liste di posta con archivi consultabili sul web (Mailman 3). Le liste stanno sotto @lists.kmalloc.org. Se te ne serve una, chiedila. +apri. +

    + +

    Git

    + +

    +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. +apri. +

    + +

    Mastodon

    + +

    +Un server Mastodon. Il tuo indirizzo è @nome@social.kmalloc.org. L'account si può chiedere direttamente sul sito: le richieste si approvano a mano. +apri. +

    + +

    XMPP chat

    + +

    +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). +apri. +

    + +

    Matrix

    + +

    +Un homeserver Matrix: indirizzo @nome:kmalloc.org. Usa il client web Element o qualsiasi app Matrix con homeserver matrix.kmalloc.org. +apri. +

    + +

    Video conferences

    + +

    +Videoconferenze con Jitsi Meet. Chiunque abbia il link può entrare in una stanza; per crearne una serve un account. +apri. +

    + + + +

    +Le donazioni sono benvenute e aiutano a tenere acceso il server. Indirizzo Bitcoin: +{{btc}} +

    + +

    Da sapere

    + +

    +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. +

    diff --git a/content/site.toml b/content/site.toml new file mode 100644 index 0000000..62b3bf6 --- /dev/null +++ b/content/site.toml @@ -0,0 +1,5 @@ +# Values shared by every page. +base_url = "https://kmalloc.org" +manifesto_version = "1.0" +contact = "squid@kmalloc.org" +btc = "bc1qsj5qadrzlqmfwcru4fwuqvftg833te5f9mja2c" diff --git a/logo/web/apple-touch-icon.png b/logo/web/apple-touch-icon.png new file mode 100644 index 0000000..95afa6b Binary files /dev/null and b/logo/web/apple-touch-icon.png differ diff --git a/logo/web/favicon.ico b/logo/web/favicon.ico new file mode 100644 index 0000000..4d4c1ee Binary files /dev/null and b/logo/web/favicon.ico differ diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..e2a7363 --- /dev/null +++ b/static/style.css @@ -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; + } +} diff --git a/templates/badges.html b/templates/badges.html new file mode 100644 index 0000000..2802b66 --- /dev/null +++ b/templates/badges.html @@ -0,0 +1,4 @@ +

    +Valid HTML5 +Valid CSS +

    diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..822100f --- /dev/null +++ b/templates/base.html @@ -0,0 +1,24 @@ + + + + + + + + + + + +{{alt_links}} + +{{title_html}} + + +{{header}} + +{{content}} +{{footer}} + + diff --git a/templates/footer.html b/templates/footer.html new file mode 100644 index 0000000..d859060 --- /dev/null +++ b/templates/footer.html @@ -0,0 +1,7 @@ +
    +{{lead}} +

    +{{nojs}} +

    +{{badges}} +
    diff --git a/templates/header.html b/templates/header.html new file mode 100644 index 0000000..63fca52 --- /dev/null +++ b/templates/header.html @@ -0,0 +1,17 @@ +
    + +
    diff --git a/templates/latest-news.html b/templates/latest-news.html new file mode 100644 index 0000000..e1ab751 --- /dev/null +++ b/templates/latest-news.html @@ -0,0 +1,10 @@ +

    {{nav_news}}

    + +

    +{{news_p}} +{{news_all}}. +

    + +
      +{{news_items}} +
    diff --git a/templates/lead-back.html b/templates/lead-back.html new file mode 100644 index 0000000..0de9743 --- /dev/null +++ b/templates/lead-back.html @@ -0,0 +1,3 @@ +

    +{{back}} +

    diff --git a/templates/lead-home.html b/templates/lead-home.html new file mode 100644 index 0000000..8640eaf --- /dev/null +++ b/templates/lead-home.html @@ -0,0 +1,3 @@ +

    +Free Your Mind… and Your Ass Will Follow. +

    diff --git a/templates/lead-news.html b/templates/lead-news.html new file mode 100644 index 0000000..095de7f --- /dev/null +++ b/templates/lead-news.html @@ -0,0 +1,5 @@ +

    +{{news_all}} +· +{{back}} +

    diff --git a/templates/news-post.html b/templates/news-post.html new file mode 100644 index 0000000..ff4d43f --- /dev/null +++ b/templates/news-post.html @@ -0,0 +1,7 @@ +

    {{post_title}}

    + +

    + +

    + +{{post_body}}