Reborn in Hugo
It’s been a while since I did much blogging and worked on this site. However, this fall I got a bit of inspiration, so I figured I’d blow off the dust and try it again. For me, writing takes real effort. I have to turn off other distractions and focus. Instead, like usual when I work on my site, I procrastinate it a bit by working on the underlying technical aspects, less on the content. So now that I have how I want it (mostly), it’s time to make some content. I figured recapping what I did and why while it’s still fresh in my head would be perfect for future me to look back on and see in 2 years when I inevitably do this again.
Where I was
I’ve had a few iterations of this site over the years. Each time I tend to gravitate towards what I’m working with most recently that sparks the most interest. In the early days I started with a Rails app since that’s all I had worked on. I then tried Jekyll since I had found something at work that used it and got my first introduction to static site generators. Then when I started doing full frontend development at work, I even got the idea to pay one of our graphic designers to help design a custom site for me to fully implement. I quickly realized that I had just created a massive pile of procrastination work and I would never write content because of it. I came to terms with the fact that while I wanted something custom from the ground up that I could call my own, it would take a long time for me (since I’m not a CSS expert) and likely wouldn’t be as good as many out of the box themes out there.
At that point in time, I was working in React heavily day to day and GatsbyJS was all the new hotness. It had everything going for it: it used React, had buzzwords words like “blazing fast”, and used the other new hotness GraphQL. While it’s definitely an amazing product, I think the major reason it stood out amongst the plethora for other site generators was that key blend of some of the hottest topics in the JS community at the time. I bit, landed on it, and setup a pretty nice-looking theme.
Why not continue with Gatsby
So, coming back to this after a year and a half of not touching it, I knew I had to update it in some way. I mean, technically yes, my versions were pinned, the app still ran fine, and I could easily add markdown files for content and proceeded. But I have a somewhat compulsory obsession with keeping things up to date and using the latest and greatest. And as we discussed, why not use it as an excuse to procrastinate writing learn something new. I largely chose to move away from Gatsby due to some pains and gripes I had in the past with it. In all fairness, some of these issues are likely better in the newest version of Gatsby, but I wanted to try something else.
Configuration Hell
One of my main pains I remembered was really getting setup and going with the blog in the first place. While it was dead simple to install and run a basic Gatsby site with a few pages and markdown content, extending it and customizing it was pretty hard for me. Probably the main confusion was that I hadn’t used GraphQL before which is how Gatsby’s build time data layer is managed. I understood the basics of it from reading many tech blogs on it and watching a lot of conference talks, but building a big gatsby-node.js file to build out all your nodes and edges and understanding the gatsby image queries were difficult for me at first.
Luckily using a theme got me over most of the hurdle to start but left me with a mess to live with. I had poured over the themes to find something I liked visually. But “using a theme” seemed to be little more than forking the repo. I ended up with a slew of typescript files with a CSS in JS pattern I hadn’t used before. I have nothing against those technologies, I’m just not familiar with them and they added even more mental overhead to understand how to edit things. I now know that 2.0 offers themes vs the original was just “starter sites”, so this problem is likely solved and I can’t hold it against it now.
Nodejs
Don’t get me wrong here, I love JavaScript the language and use it as my main scripting language (next to ruby). I’ve also worked in React heavily for years and it’s a great solution if you have the problem it solves. However, I’ve never been a big fan of the NPM package and bundling ecosystem. Installing hundreds, if not thousands, of NPM packages still seems insane to me and I’ve fought webpack and NPM issues far too much at work over the years for me to have much love for them.
In the end, choosing to switch was really just a combination of some past gripes, wanting to try something new, and really using the right tool for the right job. This isn’t mean to be a fair evaluation of Gatsby; I didn’t even try 2.0. Gatsby still seems like a really great product with an awesome ecosystem of plugins and a unique multi-sourced GraphQL based backend configuration system. However, at the end of the day, I’m making a static blog content site, and as much as I like React, I really don’t need it for this. A simple html templating system does just fine.
Let’s Go with Hugo!
So, as you as the title suggests, I went with Hugo for my new site. Admittedly, it wasn’t because I had done a thorough evaluation of Hugo vs Gatsby vs the literally hundreds of other static site generators. Instead I picked it for 2 fairly weak reasons to be honest:
In the past year I had started doing some Go at work. Primarily, I worked on creating a custom internal terraform provider for our services (I’ll write a post about that later). Our organization also whitelisted using Go for AWS Lambda based development so I had tinkered with it there. Admittedly, this is a very weak reason to pick Hugo since I haven’t done any Go other than some basic loops and if’s in the templates. But hey, why not.
The second reason is because I had recently worked on moving Cerner’s public from a very old Jekyll site to Hugo as part of our ShipIt program (a quarterly 24 group hackathon competition). I had become involved in the blog being on Cerner’s Dev Culture Council and we were looking to revamp it and add some automation around the difficult publishing process. It was pretty easy to get going even after having never worked with Hugo. You can see our post about the work here https://engineering.cerner.com/blog/we-are-back-w-new-look/ and a tweet about it.
We are excited to share with you our Engineering Health blog revamp! Read @che55er's blog for all the details about the update & be sure to check out the new site! https://t.co/dIGlizrkWQ pic.twitter.com/yFZZV83M2U
— Cerner Engineering (@CernerEng) August 4, 2020
So, with little more than this, I swapped it over. It only took a day to really move it over and get the content mapped over. As expected though, I then spent the next 2 weeks adding features and tinkering. The one thing I do love so far is I’m able to go make PRs to the theme repo to fix and enhance things.
Overall the experience has been pretty great! The theme is super slick (thanks to toha ) and I’m enjoying it so far.
That’s probably enough for why. I think my next post will be around all features and enhancements I’ve been tinkering with. Stay tuned!
comments powered by Disqus