This Blog (is cursed) [2023/05/15]
Welcome to this blog that I hopefully won't forget about.
Window Decorations
100% CSS, no Javascript. There are invisible checkboxes that control the maximize and minimize state of the window. Their respective buttons are just labels.
How post listing and posts work
caddy-cgi. This entire site is just a set of bash scripts and "template" HTML files. The "templates" are just HTML comments that get replaces via ${VAR/a/b}
. Markdown is rendered to HTML via pandoc.
postlist.cgi
#!/bin/bash
PAGE=$(cat ./list.template.html)
function postsMarkup() {
readarray -t posts <<< $(ls ./posts/)
out=""
for name in "${posts[@]}"; do
out+="<a href=\"/p/${name/\.md/}\" class=\"filelist-entry\">\
<img src=\"/img/file-icon.png\" alt=\"File icon\" aria-hidden=\"true\"/>\
<span>$name</span>\
</a>"
done
echo "$out"
}
PAGE="${PAGE/<!-- posts -->/$(postsMarkup)}"
echo "Content-type: text/html"
echo
echo "$PAGE"
The main site (is also cursed)
The main site is also a bash script. Links and buttons are read from a set of files and replaced the same way.
What next?
idk lol