Hugola

Approximately a month ago I fell for the new Dell XPS 15. It had the right price/spec combination (I went for the high-end model with 512GB SSD) so I went for it. This had of course some drawbacks, the main one leaving a *NIX like system.

Of course I am not the first guy making the switch, so there are lots of helpful resources around (although I might write one for the data scientists using Python).

One thing struck me though: Jekyll has no official Windows version. There is on unofficial guide but I wasn’t too eager to follow that. So I started playing around with Pelican, as I know some Python and as this is the tool that I already use with the GoDataDriven blog and website.

Around the same time, I saw the announcement, on Hacker News, of Hugo 0.15, that introduces a Jekyll import tool. And, more importantly maybe, it offers a simple .exe binary that you can just drop anywhere and call with hugo (or hugo.exe).

So in between things (mostly in the train) I gave it a go and issued:

hugo import jekyll jekyll_blog_folder hugo_blog_folder

Magically, all of my posts were converted. The code highlighting and the front matter were adjusted accordingly to hugo syntax (although I had to adjust the url). What was left out was the theme.

So the longish part of the transition began: rewriting my old theme for Hugo. Albeit the process was not difficult, some extra docs could have helped. Moreover the way to two theming engines works is different. But in the end I’ve finished and now my blog (and website) too is running with the hugola them (from hugo + Lanzani, but it nicely resembles ugola, which is the Italian for uvula).

In the process I removed some cruft: I removed JQuery and therefore Bigfoot and rewrote the other only thing that was using JQuery: the activation of the blue above the current page in the side bar. The old code was the typical exaample of JQuery usage:

$( ".blog-active" ).addClass( "menu-item-divided pure-menu-selected" );
$( ".blog-active" ).removeClass( "blog-active" );

The above snippet searches for the blog-active element and add the classes needed for the highlighting. It turns out that you can do the same in pure (modern) javascript if you make blog-active or whatever other class you’re using, into an id. Then you’re off with the following:

window.onload = function() {
document.getElementById("blog-active").className = "menu-item-divided pure-menu-selected pure-menu-item";
};

While these changes do not make it easier to blog, they are a symptom that I should have a bit more time to do so. So hopefully I can begin crunching posts again!