- Python 39.1%
- HTML 34.8%
- CSS 26.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- add MANIFESTO.es.md, MANIFESTO.de.md and MANIFESTO.fr.md, translated from version 1.0 - publish them at /es/, /de/ and /fr/ with a short header and a translation note - list every translation in the language links of the header - point all language versions at each other with hreflang alternates - keep news and the other pages in English and Italian only |
||
| badges | ||
| content | ||
| fonts | ||
| logo | ||
| static | ||
| templates | ||
| .gitignore | ||
| build.py | ||
| MANIFESTO.de.md | ||
| MANIFESTO.en.md | ||
| MANIFESTO.es.md | ||
| MANIFESTO.fr.md | ||
| MANIFESTO.it.md | ||
| README.md | ||
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.templates/holds the page chrome:base.html,header.html,footer.htmland a few small fragments.static/style.cssis the one stylesheet, inlined into every page.content/site.tomlholds the values shared by every page: contact address, Bitcoin address, manifesto version.content/<lang>/lang.tomlholds the chrome strings of one language (en,it,es,de,fr). Spanish, German and French have the manifesto only and use the short header (templates/header-min.html).content/<lang>/*.htmlare the pages: a front matter block, then an HTML fragment.content/en/news/holds the news posts. News are written in English only.MANIFESTO.en.mdandMANIFESTO.it.mdare the manifesto texts, version 1.0.MANIFESTO.es.md,MANIFESTO.de.mdandMANIFESTO.fr.mdare translations of it.fonts/terminess.woff2is 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, the original PNG and the favicons inlogo/web/.
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 translations, nav is the menu entry to highlight. The language links in the header list every other language that has a page with the same id. 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/en/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 Italian pages 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.