Meta First Post - Setting Up a Personal Site with Hugo and Github Pages

I’d done it a half dozen times before. Scorch the earth on my webserver, start a new database and spin a new Wordpress blog with the purest of intentions. But this time would be different! It always is.

THIS TIME IS DIFFERENT! I’M GOING TO USE GHOST!!

I’ve used Ghost a few times on teams and it’s really nice. Not throwing stones here. But I had that nagging feeling as I dug into guides for setting up Ghost on Digital Ocean. I fretted over which Linux distro to use, or whether to allow comments. Tangents and rabbit holes abound.

I don’t need that.

I need simplicity. I need speed. I need ease or near-absence of maintenance. I need to type words and have them display on a screen. I need a static site.

I’d heard great things about Jekyll, and if I hadn’t recently been learning Go, maybe I would finally be playing with Ruby. But today is not that day. So Hugo it was.

I’d noticed a few peers were hosting their blogs and portfolio sites on Github Pages. Awesome, source control plus free webhosting. Now I don’t have to shell out money each year to not update my blog. Wait… I mean, this time will be different!!

So, I quite easily found this guide for using Hugo to publish static websites on Github Pages.

Words are for reading.

I hope I will continue adding content to this site in the same way you see here. I may ramble at bit at times. But I will not just share my victories and paint them as flawless.

I wasted a good evening trying to follow the steps at the top of the guide linked above, which was intended to establish a gh-pages branch for a project repo. That was NOT what I wanted. It’s no big surpise that I got build errors when I tried to have a gh-pages branch in a repo named such that it gets automatically built as a github page. I scrolled further into the guide to find the steps accurately and obviously titled “Host Personal/Organizational Pages.” After swearing at myself and some pro-level face-palming, I continued on my quest.

Here’s the gist.

  1. Download and install Go and Hugo.
  2. Create Github repo for building site and authoring content - https://github.com/hitjim/hitjim-hugo
  3. Create Github repo for hosting site. You can witness the litany of errors in the early commit history! - https://github.com/hitjim/hitjim.github.io
  4. Locally clone and enter hitjim-hugo repo, install a theme I liked.
  5. Then ape the config file from the author of that theme’s blog for my own config file at the root dir of the project, while making the appropriate personalizations.
  6. Run hugo server --watch -t hyde-x to start a local dev server that watches and updates when it detects changes.
  7. Run hugo new about.md to make and then edit my about page.
  8. Run hugo new post\meta-first-post.md to to make and then edit this very post.
  9. Delete the public folder as instructed and run hugo on its own for the final build.
  10. Copy contents of public to the hitjim.github.io repo, create a CNAME file containing only my domain name hitjim.com, and push changes to Github.
  11. Configure my domain registrar to play nicely with Github Pages. Much of this page helped me get it right. In my case, I just needed “A Record” type entries, one with host @ and another with www, and each one pointing a static IP for Github Pages - 192.30.252.153 and 192.30.252.154.
  12. Be possibly a little too pleased with myself.