summaryrefslogtreecommitdiff
path: root/blog/2025-10-03-website-rewrite.md
blob: a2eb1dbb9ffda5dabe678bc523b48058bca49cb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Rewriting my website the second time

My previous website was using a custom rust HTTP server that rendered the site
from scratch on every request; this allowed for some really nice interactive
features but was overall not necessary. I am replacing that system now because
it had problems compiling and was overly complicated which lead to me never
updating it.

That is why my new website system is as simple as possible (not really). All
pages are rendered statically from a HTML template and a markdown content file.

For few places where I need some kind of scripting I use XML Processing
Instruction syntax which is interpreted by the python script I use to render
markdown aswell. These instructions take the form `<?ex echo "Hello world" ?>`
(yes. PHP uses that syntax too); This example would run the `echo` command with
the system shell and replace the PI with its output. Currently all of instances
of these PIs are processed seperately with no way to pass variables between them
but I might actually write a proper implementation of this where it works;
basically creating "PHP but shell".

This entire system is implemented in only about 40 lines of combined source code
in python and makefile. That's it, hope that was interesting.