Static Site Generation with blogc


Up until now I’ve been working on my sites in pure HTML; the only tool I used had been ssg to convert the little “wiki” I put op on GitHub to HTML and use it on my website.
Creating a HTML file every time I wanted to post something on my website is not a viable alternative, though, which is why I was looking for an option to make my life easier. I decided to ask people on the webring thread on lainchan for advice on how to set up a proper workflow for web development, as I am completely new to this.
The nice guy from helped me get some ideas, which ultimately led me to blogc, the static site generator which I’m going to talk about here.

Why I chose blogc

Blogc is simple yet powerful. On their website they state it should be used with a tool like make. It’s not supposed to be a blogging engine but a compiler.
I like this approach, as I am a fan of C (programming language). To be perfectly honest, I don’t have all that much knowledge about make, but I want to learn, and this is part of the reason I’m making this website.

Starting out

To start, I downloaded the test repo they have up on GitHub ( so that I don’t have to figure out everything by myself, as this could also be seen as a piece of documentation.
From there, I started changing my own template.html I had to function as a blogc template. If you want to follow this a bit, have a look at my repo and compare it with the example repo blogc provides.


So far the template is really simple. As I said, I took the template.html I had and changed it to resemble a blogc template. The title is now set per page, copied from the template from the example repository. The links in the navbar are changed so it’s easier to change them, should I ever get another domain.
The main section is now filled with template things. I won’t go into detail, because the man page blogc-template goes into enough detail. It’s essentially just pasting the content of the source file in between the main tags.


Writing the Makefile was a difficult thing for me. Every time I have to write one I need to skim through the documentation again to get stuff done.
Trying to imagine how my site should function with software I’ve never used before is also hard to do.
As I said before, you can find everything, including the Makefile, on my GitHub page.
I also took some inspiration for my Makefile from the example repo. A lot of the variables are taken straight from their Makefile, with values changed, obviously. I removed everything I didn’t need, which included some variables and rules, and I was left with only one rule which I changed to my liking and used as a template for the rest. If you’re not familiar with Makefiles, they’re fairly easy to understand when you figured out the syntax, which is admittedly a bit weird.
For now I list the files I use individually, so I need to add each new blog and wiki entry I the list manually. Depending on where I use the files I pre- and append them with the directory and file ending respectively.

Blogc has 2 modes for compiling:

  • The standard entry mode
  • Listing mode

In entry mode, your entry and variables defined in the source file are available as usual. In listing mode blogc handles every source file taken as an argument. In your template, listing blocks are being executed for every source file to be compiled into one output file.
I compiled my homepage, about, the privacy policy, etc. in entry mode and, for now, will be compiling my blog posts in list mode. The reasoning behind this is that I’m trying to figure out how to generate a listing without listing the content, but will be looking into this another time.

That’s about everything I can talk about. The content as well as the design on this site is largely the same as before, with just a few changes that are probably not even noticeable.

Do you have a comment on one of my posts? Feel free to send me an E-Mail:
To participate in a public discussion, use my public inbox: ~witcher/
Please review the mail etiquette.

Posted on: December 21, 2020

Articles from blogs I read

Understanding the XDG access portal

The upcoming version of Firefox 116 will use Pipewire for camera access. This sparked my curiosity and I wanted to know if my setup would work for this. In recent times, Firefox has been moving rather quickly, adding dependency on these Flatpak portals (e…

via Hugo Barrera's site June 20, 2023

Reforming the free software message

Several weeks ago, I wrote The Free Software Foundation is dying, wherein I enumerated a number of problems with the Free Software Foundation. Some of my criticisms focused on the message: and together suffer from no small degree of incompreh…

via Drew DeVault's blog June 19, 2023

Status update, June 2023

Howdy! This monthly status came a bit late, but nevertheless, here it is. Husky-related news, the implementation for UnifiedPush support is going well. Husky is able now to get notifications not polling each N minutes but using a UnifiedPush provider from now…

via captainepoch's log June 15, 2023

Generated by openring