Category
Back in May of 2022, I wrote about a predicament I found myself in with multiple websites built in Drupal and the chore of upgrading in the right sequence to avoid incompatibilities with the installed version of PHP on the web server. I began to look around at my options and discovered others that also had fallen out of love with Drupal were turning to static web page builders, several of them to Hugo.
This sounded very much like the adage, "What's Old is New Again!" But this time it's different.
In the beginning, we all built our sites by hand with HTML. It wasn't long before that became quite tedious and we turned to scripting to add content to our sites, using such languages as Perl or PHP or maybe ASP.NET. This was, of course, much better than manually updating HTML pages, especially if you also maintained a table of contents, an index, and a site map. HTML editing tools proliferated.
Then some people productized their scripting and Content Management Systems became a thing. This was even better because it allowed non-programmers to maintain their site and encouraged more features and multiple people and separation of code and data and design. All these were good things but as web sites got more complex and security issues crept in, these simple frameworks blossomed in size. Some of my early Drupal sites were less than 500 KB; the latest version of Drupal is nearly 120 MB and includes almost 20,000 files--and that's just the core install. After that, there are modules and themes and profiles and customizations--then security updates and bug fixes! IT NEVER STOPS!
So, now I want to throw all that away and go back to hand-editing my content? Well, yes, actually!
My research and testing led me to try out Hugo; a year ago I wrote about this new direction and during 2023, built a couple of small sites in Hugo for a client, Modular Building Solutions, and a personal photo album for our family. I wrote some utilities and really liked editing the simple Markdown pages, running Hugo to rebuild the HTML pages, then uploading. In fact, with GitHub Actions, simply pushing updates to a remote repository can kick off an automatic site update.
I was having fun again!
Now the task of converting the content in my Drupal sites to Markdown pages lay in front of me. The first one I wanted to tackle was the Oregon Delphi User Group for which I am the coordinator. It's version of Drupal was fairly old and there were a couple of minor issues whenever I added meeting notices that I had to work around. Plus, I didn't really like the theme but didn't feel like customizing it. You can see what it looked like on the Wayback Machine.
So, over the holidays, I took some time, found a script (or was it this one?), exported the content, and got to work.
And yes, it took some work to get all the content converted because the Drupal content editor allows different formats of text, including Full HTML, which I often used so I could customize parts of the entries or attach images and align them properly. The problem with that is it doesn't just store the text, it stores the HTML that I entered as well. So what I exported had to have its HTML tags removed and replaced with Markdown. There was probably an easier or more automated way but I had other edits to make as well. Instead of using Drupal's "Taxonomy" system to set up events by year, I just associated "year" tags to the various posts. Then, since I was adding tags anyway, I added a few other tags for speakers and topics. As I kept building and reviewing the finished site (which is nearly instantaneous with Hugo's in-memory server feature), I made other tweaks. Adding a theme was just as fun because I found one that was easily modified to make the posts look like Pascal procedures!
I unveiled it yesterday and so far, I've gotten positive feedback. I think it looks better than the old one, and it's MUCH faster because it's no longer running through a PHP interpreter to generate HTML, it just serves the pre-built HTML files. There's so much less to configure and, of course, there are NEVER any security concerns--but then again, it's just a static site that gets updated about once a month.
Check it out: ODUG.ORG. And if you maintain a static site, you should try Hugo for yourself!
Good move. I also use Hugo…
Good move. I also use Hugo and it feels good to have full control of your website. The website is also so lightweight and loads extreme fast compared to all bloated websites.
Nice work and the website looks great 👍
David, this is a fascinating…
David, this is a fascinating article. After reading this I will definitely look into using Hugo.
Add new comment