- Python 39.1%
- HTML 34.8%
- CSS 26.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- say that the website sets no cookies and logs no visits - say that technical logs with IP addresses are deleted after 14 days - describe the bans for repeated failed logins and how long they last |
||
| badges | ||
| lang | ||
| logo | ||
| news | ||
| static | ||
| templates | ||
| .gitignore | ||
| build.py | ||
| MANIFESTO.de.md | ||
| MANIFESTO.en.md | ||
| MANIFESTO.es.md | ||
| MANIFESTO.fr.md | ||
| MANIFESTO.it.md | ||
| README.md | ||
| site.json | ||
kmalloc.org
Sources of the kmalloc.org website: plain static HTML, no JavaScript, valid HTML5 and CSS.
Layout
build.pygenerates the site:python3 build.py [output-dir](defaultpreview/). Standard library only.site.jsonholds what every language shares: the language list, contact address, Bitcoin address, manifesto version, services and people.lang/<lang>.jsonholds every text of one language (en,it,es,de,fr): the menu, the footer and one entry per page. The texts are plain text and the build escapes them.templates/holds the chrome (base.html,header.html,footer.html), one body per page type intemplates/pages/and repeated blocks intemplates/parts/.static/style.cssis the one stylesheet, inlined into every page.MANIFESTO.<lang>.mdare the manifesto texts, version 1.0. English and Italian are the sources, Spanish, German and French are translations.news/holds the news posts, written in English only.badges/holds the official W3C badges, served from our own site.logo/holds the shrike logo: SVG and PNG exports,build_logo.py, the original PNG and the favicons inlogo/web/.
Languages
A new language is one file, lang/<lang>.json, plus its name in site.json and a MANIFESTO.<lang>.md. A language lists only the pages it has: Spanish, German and French have the manifesto only, so they use the short header ("header": "header-min") and the other pages are not built for them. The language links in the header list every other language that has the same page.
A page entry in lang/<lang>.json looks like this:
"people": {
"path": "/people.html",
"title": "kmalloc.org: People",
"description": "The people behind kmalloc.org.",
"intro": "Who is behind kmalloc.org.",
"bios": { "squid": "..." }
}
The page types are home, manifesto, people, services and news. Placeholders such as {{intro}} or {{url_news}} in templates/pages/*.html 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 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. News are English only: the pages of the other languages list the same posts and link to them. The news index, the latest three posts on the home pages and an RSS 2.0 feed (/news/feed.xml, the latest 20 posts with full text) are built from the files. Every page links the feed in the head and shows the RSS icon in the footer. No em dashes: the build refuses them.
Publishing
Pushing to main publishes the site. A post-receive hook in the Forgejo repository touches a trigger file, deploy-kmalloc-site.path on the server notices it and runs deploy-kmalloc-site, which builds main into a temporary directory and mirrors it into the web root. If the build fails nothing is copied.
I check every page with the Nu HTML Checker before pushing.