Niall’s virtual diary archives – Friday 29 March 2019

by . Last updated .

Friday 29 March 2019: 20:09. Long time readers of nedprod.com may have noticed a fairly dramatic change in website theme last Wednesday or so. This is because I’ve ported the whole website from its 1990s-era Microsoft FrontPage roots to Hugo, a modern static website generator. This is probably the single biggest upgrade I’ve ever done to nedprod.com, it has been many months of night times after work writing Python scraper scripts, writing a nedprod.com theme for Hugo so this content would look fairly similar to the previous website, and of course a ton load of manual checking of the automated conversion for correctness.

The previous website was a direct evolution from when it was begun in 1998. Microsoft FrontPage was upgraded to Microsoft Expression Web, various upgrades for new content such as CSS, XHTML, Unicode and microformatting occurred over the years. A fair chunk of custom PHP scripting implemented pseudo-dynamic website features, such as scanning all the XHTML content into an Atom RSS feed, and then rendering that RSS feed dynamically as pages.

That solution served me well, as at that time there weren’t static website generators sufficiently capable that I could move on. However my recent work with Hugo to implement Outcome’s documentation persuaded me that Hugo probably – just about – had enough flexibility to do a high fidelity conversion of nedprod.com.

And I’m fairly pleased with the outcome. The original 1990s tables-based layout has finally been dropped in favour of a modern CSS3 flexbox specified layout. This renders much quicker than before, and it’s noticeable how much snappier the website appears in a browser. We now have local Javascript-based search without having to rely on Google, who kept breaking their embedded search script in any case. We have dropped all scripts entirely from almost all the pages, so pages now load script-free for the first time I think since 1999. We dropped XHTML in favour of HTML5, as we no longer need Python and PHP to process the content as XML. And all the content, even the very oldest content, is now in UTF-8, I found a wonderful Python library called ftfy which will repair unicode corrupted text, if it can, and it has done an amazing job on reconstituting almost all of the older content back to its pre-corruption glory. Oh, and I still have the SQL page visit counters on the top of every page, but instead of using MySQL, it now uses a SQLite database file using PHP’s new PDO generic database framework. The counts were ported over from the old site, plus most of the links have been preserved, so the visitor counts are still accurate.

The new tooling, Hugo, opens many new doors. Firstly, I can now write posts in Markdown instead of HTML – this post is the very first of what will be many written in Markdown. Secondly, Hugo autogenerates a RSS feed for me, and at some point soon I’m going to hook that into auto-posting to Diaspora and Pleroma, now that Google Plus has gone. Thirdly, I should be able to plug an Android app which speaks ActivityPub (probably AndStatus) into being able to post content here. Or I may just make a private web form with Markdown editor which can post new entries here from any web browser, and make that mobile friendly e.g. with picture upload and GPS coordinates etc.

So far, so good. And just in time for the Google Plus shutdown. I made it!




Go back to the archive index Go back to the latest entries

Contact the webmaster: Niall Douglas @ webmaster2<at symbol>nedprod.com (Last updated: 2019-03-29 20:09:10 +0000 UTC)