Using a static site generator now.

Published on: 2020-10-01

I designed this site quite a long time ago, and never really used it too much. Then, a few days ago, I decided to start this blog to see if I would enjoy this type of writing. As it turns out, so far I do. It also helps me practice touch typing, which I have recently started learning. Anyhow - since I plan to write at least a post a week, this blog needed to be built on a more solid approach other than copying template html files. I needed a site generator.

I wanted one that was minimal, preferrably written in C, and which supports nice markup features along with not sticking Javascript everywhere. While I am sure that there are many such tools out there, my choice fell on blogc because of its incredibly well written documentation, along with its fast execution speed.

The initial port was trivial, as blogc is built pretty straight forward. You define a template, and then call blogc to compile html from this template. It can use plain text files in order to insert content into posts, which allows me to concentrate on the content when writing, instead of thinking about the way it looks later. The plaintext that was used to generate this post, for example, is located here.

Then I wanted to show the last three posts on the index page. First I thought I had run into a problem, since there is no way to limit the number of blocks within the templating language. I emailed the author, Rafael Martins, and he told me about the filtering mechanics that could be used for this purpose. See the Makefile, the magic parameters are FILTER_PER_PAGE and FILTER_PAGE. There is even documentation about these parameters, but I missed those for some reason, shame on me.

Anyhow, quite happy with this setup so far. Might need a few css tweaks, but time will tell. I can't recommend blogc enough.

Site generated on 2024-01-29 14:07:12. Changelog on Github.
Subscribe with RSS: https://lpcvoid.com/rss