How theblackzone.net is maintained
Over the years I have changed the ways to maintain the content of my websites numerous times. The current version is created with the HUGO static site generator, but there had been many other tools, from obvious to obscure.
A bit of history
On the History Of TheBlackzone page I already mentioned a couple of tools I used in the past, but here is a more complete list in chronological order:
- Microsoft FrontPage was used in the very beginning. And while this might seem laughable today, I didn’t know anything about HTML and it helped me getting started into publishing on the web.
- As soon as I had learned more about HTML, I switched to Allaire Homesite 4 to comfortably edit HTML code directly.
- Then I used UltraEdit for direct HTML editing with a set of self-made templates.
- Then came VIM (and stayed to this day) for direct editing of HTML with my own set of macros.
- Early steps with “blogging” (before this term was even invented) where made with “NewsPro”, later renamed to Coranto.
- Followed by Personal Weblog.
- Then came the Pivot Weblog.
- Finally switched to the famous Wordpress.
- And to Habari (site offline), which I used for the longest period of time so far.
- In 2018 I switched to my own ‘static site generator’ using m4 macros and a set of scripts
- in 2021 the HUGO static site generator took over
In retrospect I guess I would have stayed with the Habari weblog because I really liked it. But when it became clear that it was no longer developed/maintained and it was only a matter of time when the next PHP upgrade would break it, I started looking for something new.
I didn’t want to bother with another blogging system or database driven content management system. Instead I wanted to go with plain, static HTML pages again. But, of course, I didn’t want to edit them as pure HTML code like I did 25 years ago, although that would have been a viable option since this site is rather small.
So, the first option I was looking at were some of the plenty so-called static site generators. These tools take some form of textual input (mainly Markdown texts) and convert them to static HTML pages. But after having tried a couple of them, I felt that they were not my cup of tea and decided to create something myself.
At first I created a couple of scripts that took Markdown files and converted them to HTML pages with the help of Pandoc. This was pretty much the same thing the static site generators did, but in a leaner way and with more fine-grained control. It worked great and did exactly what I wanted. However, after a while I found my self putting more and more native HTML code into the Markdown source files because I reached the limits of Markdown’s formatting capabilities. And while Pandoc easily handles that kind of mixture between HTML and Markdown, I didn’t like the “mess”.
The next iteration had been a different approach: Instead of creating a source file in some format (Markdown in the former case) and convert it to HTML, I used HTML pages that contain “macros”, which expanded to HTML code by using the m4 macro processor.
This approach may seem to be a quite unusual (or more bluntly put “esoteric”), way to build a website, but it worked quite well. Basically it works like a templating system and a typical page in source form looked like this:
_HEADER_ <h1>_TITLE_</h1> <p>Here is some text in HTML format.</p> _FOOTER_
_TITLE_ in this example are the macros, that will be expanded to full HTML code based on the macro definition.
_HEADER_, for example, included the HTML header code, containing everything until the page content text starts.
_FOOTER_ expanded to the HTML page footer code that closes the page, while
_TITLE_ just contained the page title. The macros themselves are created in external files and just referenced when executing the macro processor.
This mechanism was wrapped in a Makefile and involved two supplementary script files that were used to create the front page (“latest posts”) and the navigation (“tags”, “archives”, etc.) page.
This self-knitted “site generator” worked quite well for me and I have been using it for a couple of years.
At some point however I had been looking into other static site generators again and became quite fond of HUGO which initially impressed me with its speed and a set of features that you would normally only see in database driven dynamic systems.
While HUGO is a self-contained system, I still use it in conjunction with a Makefile that handles some housekeeping tasks.