Getting Started With Hugo

Preface

I am not a web guy by any means, I’ll start with that.

Secondly, CSS and div trees and the sort DO NOT come naturally to me. So building my own static site wasn’t going to happen to easily for me either.

Hugo has made the process of getting this site started so easy, I have a hard time explaining exactly how much it helped. I had a bit of learning to do, since I am really bad with front end/web app stuff in general, but once I got the hang of things I had this site together from drafting, first render, to setting up apache and deploying on my server in less than one day.

Why static?

I chose to go static since my site was supposed to be a simple portfolio, I didn’t want the challenges nor security risks of running a dynamic site with a CMS like WordPress. I don’t have the time to maintain and constantly update packages, plugins etc so it only seemed logical to go static. With static there is less threat of issues like scripting languages being taken advantage of or databases being compromised (things like sqlmap and msf make it all to easy to open shells through a vulnerable database)

So why Hugo?

Well to be frank, I just ran across it and it worked for me. I didn’t have a real reason for going with it other than that. I will say that being able to write my pages in markdown has given a level of enjoyment to writing posts.

So … how Hugo?

It’s painfully easy, really, for the most part you just grab a precompiled executable and follow the quick start guide. The one thing that didn’t seem clear to me from the start was many changes you want to make will have to be made in the theme’s directory. If you followed the guide you likely added the theme as a submodule of your site. I also went ahead and made my site’s source a git repo (a tool I’m not familiar with behyond some basic commit work) which lead me into a whole rabbit hole of learning how to use submodules. Adding the theme of your choosing as a sub-module keeps it from being included in your project however, so if you make any changes you’re going to want to find a solution for maintaining your changes. I added changes as a fork to the master of my theme, hopefully the pull request will be accepted and I can switch to the master again!

My Git incompetence aside, after editing my theme I had some reading to do. Not all themes are built the same and some have expected content layouts. For instance, the theme I’m using (hyde-hyde) is built around you having basically just a front page, a posts section, a portfolio section and an about me. Others may be more focused on products or posts.

Covered in the quick start guide is the Hugo Server that allows you to view changes live. After confirming your changes, rendering your static content and moving to your server you’re all set. Literally all you need at that point is to set up a static webserver which for my config was just about ~10 lines of config, that’s counting moving my docroot on Apache. Had I been a little more experienced with the web dev and git side of things I probably could have had my site going in less than an hour. Honestly Hugo saved me a lot of headaches and time that I would have sank into making my own static site.