Hugo and the wealth of blogging tools

Categories//

I’m not entirely sure what possessed me to look into blogging after so many years of actively ignoring it. The first surprise was the shear breadth and depth of blogging/CMS packages available. Oh my, so many things.

I looked at Ghost, but it’s node.js with all it’s many dependencies and (to me) node.js weirdness. TextPress and WordPress were both appealing as they’re PHP based and while WordPress was interesting, it was far more than what was needed. I still haven’t tested Grav or Dropplets, but Grav looks pretty cool. There were several others (Concrete5 *shudder*) that are lost in the mists of time misspent.

I also found Anchor CMS, a very barebones blog/CMS engine and UI. There’s a certain appeal to the simplicity, and I liked it enough to it setup for a domain that my kids run. If you’re going to look at Anchor use the git repo - drag and drop images are broken in the current stable version. FWIW, there are few themes that actually work correctly with the git version. The default theme and the Manifesto theme are two that seem to work well

The more I tested the more I gravitated to markdown and flat files. Simple is good, and flat files are easy to manage, backup, restore, etc. Managing dumps and restores with MariaDB or Percona is hardly challenging, but it does add “one more thing”™ to the to-do list.

In the end the one that has impressed me the most is Hugo. It’s small static website generator (like Jeykll) written in Go. The more I read through the website the more intrigued I became.

The release archive is a 15M binary and a couple of license and readme files. Just unpack it and run hugo new site <site> in any directory and Hugo will create the directory structure and a very basic configuration file. From there just cd into the site dir and clone the theme repo with git clone https://github.com/spf13/hugoThemes.git themes, and flush out the configuration file a bit.

Once you have a basic configuration you can either run Hugo as a (very fast!) server with hugo server --watch <options> or, as I do, just run it as a daemon with hugo --watch. Any changes to the markdown posts or pages are picked up nearly immediately, parsed to plain html, and then the html is dropped in the public/ directory.

From there I serve up public/ with nginx. You could use apache or nginx to reverse proxy the Hugo server process running on the default localhost:1313, and for awhile I did. But at some point the penny dropped and I realized it was rather silly to proxy it and setup nginx to just serve public/ directly.

No PHP, no Ruby, no Node.js. Simple text file articles in markdown and a pretty flexible and powerful template system. Awesome!

Tags// , ,
More Reading