Gopherhole - tizero | |
The website | |
=========== | |
Last modification on 2025-04-20 | |
No idea of what contents this website [1] will host (if any), for | |
now the purpose being just personal exploration and learning. The | |
site is hosted on sourcehut pages and built with saait [2], a | |
minimal generator of static webpages that follows the suckless | |
philosophy. | |
[1]: tizero.srht.site | |
[2]: codemadness.org/saait | |
Editing | |
------- | |
Posts are written in Org-mode, which can export to HTML natively. | |
But, even by tuning the variables for a bare output, the result is | |
still improvable. | |
* Export to Markdown within Org backend | |
;;; $DOOMDIR/config.el | |
(setq org-publish-project-alist | |
'(("website" | |
:base-directory "~/website/org/" | |
:publishing-directory "~/website/pages/" | |
:publishing-function org-md-publish-to-md | |
:md-toplevel-hlevel 2 | |
:with-latex verbatim | |
:with-smart-quotes nil | |
:with-toc nil))) | |
* Convert to HTML with Markdown.pl [3] | |
$ cd ~/website/pages | |
$ for f in *.md; do | |
> Markdown.pl < "$f" > "$(basename "$f" .md).html" | |
> done | |
[3]: daringfireball.net/projects/markdown | |
Build | |
----- | |
Saait global variables are stored in website/config.cfg and | |
overwritten by each page config file. Setting tex = katex.html | |
enables the rendering of LaTeX fragments with KaTeX [4]. | |
To build the website in website/output, | |
$ cd ~/website | |
$ find pages -type f -name '*.cfg' -print0 \ | |
> sort -zr | xargs -0 saait | |
[4]: katex.org | |
Publishing | |
---------- | |
The tarball is uploaded with hut, the dedicated utility: | |
$ cd ~/website | |
$ tar -C output -cvz . > website.tar.gz | |
$ hut pages publish -d tizero.srht.site website.tar.gz | |
Sourcehut pages does not allow to use a CDN, so the scripts and the | |
stylesheets required by KaTeX must be uploaded to the website [5]. | |
[5]: srht.site/limitations |