Site log

This is a log of general changes to the site. I realized that it might be useful and maybe interesting for others to note down what I did to the site.

I started working on this website in November 2023 so I have a place to put my coding logs and projects on and to track what I am doing.

In case you wonder: The content of this website is statically generated using a few Lua scripts I wrote. Each page (like this one) is a Lua script that contains a bit of metadata (like the title and date of the post) and the content of the page. It looks like this:

title = "Site log"
date = "2024-11-16"
brief = [[This is a log of general changes to the site and a short description, how the site is generated.]]

H1 "Site log"

[[
This is a log of general changes to the site. I realized that it might be useful
and maybe interesting for others to note down what I did to the site.
...
]]

Lua [[
-- this is the Lua script
]]

[[
Carry on ...
]]

Since it's just a Lua script, it's easy to add new features and using it.

For example, in November 2024 I added the functionality to compile C files to WASM and embedding it into the page, using this simple syntax:

CFile("meshimport_3.c", "preferred_size.c", "preferred_size.h")
WASM("meshimport_3.js", 600, 350, "meshimport_3", false, true)

The CFile is displaying and compiling the code files, and the WASM function is embedding the compiled WASM file into the page. The arguments define the used ids, width, height, etc.

To test the changes easily, I also added a very lightweight C program that acts as a web server (just listening to TCP connections and serving files in a single threaded manner - really dead simple 377 lines of code (yes, this number is kept up to date via script)). The server accepts local requests and triggers site updates. I could have used Node.JS or something similar, but... I don't like bloat, and all I needed was a primitive server to do one thing 🤷. I am planning to switch to Linux desktop at the end of the year, so I will have to make the server code portable to Linux... but that shouldn't add much complexity.

I am manually deploying the site to my server via SSH and creating a tar archive of the site. The server is running a default nginx server.

The scripts and site content is version controlled via Git. I am considering to run a cronjob on the server to automatically checkout the latest version once a day and deploying it automatically - since I have now also a feature to not deploy blog entries that have future dates on them, that would be a nice feature to have. However, the entire pipeline is currently windows based, so I would need to port the scripts to Linux first...

2024-11-29

2024-11-16

🍪