From Ghost to Hugo

From Ghost to Hugo

October 25, 2018
Hugo

Ghost has been a bit of a wild ride over the last two years. What I’d started with would now be considered ghost-legacy which was their 0.11.x series of releases. For a little while I’d actually been able to comfortable package it in the AUR. I’d abandoned packaging when ghost-cli became a requirement. Without a package I resorted to excessively using the --no-setup-<stage-name> and become increasingly frustrated with the quirky and aggressive release schedule of ghost and ghost-cli.

Ultimately, I’d chosen to leave pelican where I’d become comfortable with the entirely text based work-flow and things like jinja. I should feel thankful that ghost has pushed me to look elsewhere, because hugo is incredibly impressive.

The things that had be frustrated with ghost are almost entirely resolved by moving back to a static generation platform:

  • Operating a separate container with myriad software packages that are outside of the maintained distribution tree. As well as proxying from a fairly trusted software (nginx) to a node process that has dependencies changing on a frequent basis.
  • Attempting to shoehorn security headers over a software that doesn’t seem to care about it. There is also the upcoming Subresource Integrity, where Ghost is uninterested in handling CSP… hugo has already build a composable pipeline to easily handle things like SRI.
  • Authoring now is merely working in text with an editor, which may sound pedantic… but my text editor uses far less computational power than any modern day browser. This translates into a freedom of expression where I’m more inclined to write when my laptop is on my knees because it’s not thermally loaded.

The Hugo documentation is extensive, as well as the discussion and issue tracker… so I’m not going to attempt to write a guide on how to transition. Instead it feels of value to remark on the anecdotes encountered during the transition.

  • When creating your own theme by using the hugo new theme <name> you need to decide on using /_default/baseof.html or /index.html, in my case I wanted to use _default/baseof.html but if you examine the templates lookup order you’ll see that index.html is almost always first. So you’ve gotta remove the blank /index.html file to get started.
  • You can create a new theme (I started down this path) or you can create your own custom layout. I based my work on detox, but modified until it looked good to me. Ultimately I know what looks good to me, but don’t know how to achieve it… so this is the best that I could manage given my awful aesthetic skills.
  • You can do whatever you’d like for media management, at first I was deeply interested in using the image processing features to supplement my gimp/darktable/rawtherapee workflow… but after some testing decided on a couple things:
    • wasn’t sure that the quality of the resizing/resampling was parity with something like gimp.
    • keeping media right along side write ups makes for a far easier life if I want to go back and modify things, with something like ghost you’re working wit the final product of media… and with hugo you can do whatever you want in the folder structure that makes sense.
    • wasn’t really wanting to clobber the images down, instead it’s nice to let people download something if they like it in a form that is actually useful (everything is sampled to 4K on this site unless the source material is smaller).
  • I’ve not come up with a consistent strategy for video, I’d rather host right off my own metal but I’m not sure of a small library that can handle that well yet (looking at something like video.js scares me because it’s quite big).

Ultimately this transition has made writing fun again. I’m back in my text editor using tools like git and rsync for deployment. There isn’t anything stopping me now from switching contexts quickly and jotting down some notes about some concept that I’d like to write on (where before I’d have to have Internet connectivity and then wait for my browser to slog through loading up ghost). This has been a net gain for my “productivity” as someone who values writing things down.

There is a secondary benefit of having a modicum of understanding for how go handles templating now, Hugo is a fancy new hammer for several nails in my life.