Static site generator for personal blog

Many of us would like to have personal identity in the Internet, write blog, share pictures, code and discuss interesting topics. For tech related articles social networks would not be enought and we should look for personal blog or website solution. Here I would like to explain some ideas behing my choice – hugo, static site generator written in Go.

First of all, let us write down requirements for personal page:

A while ago I had personal page, stored on virtual machine in some cloud service. This requires me to pay for VM and causes deployment difficulties. I realized, that solution should be different.

WordPress offers good service, but price of custom domain makes use of it questionable. My decision was to use static site generator and deploy it to GitHub, because it is free. I did not want to customise site a lot from the beginning, content is more important at that period. Moreover, additional tools, such as Google Analytics and Discus comes with framework.

There are a lot of static site generators on the market. How to choose right one? My goal was to choose something simple, yet flexible to be able to use it in other projects as well.

First of all I checked python Pelican, because of my language knowledge. It looks very similar to Django. I did not really find it interesting and it’s own website was a bit ugly.

Next, I try JavaScript based generators. From my point of view, technology itself should be as close to frontend development as possible. For example, I would rather go for JavaScript instead of Ruby. I was not able to setup Assemble in 20-30 minutes and found it not easy to work with. Another JavaScript tools I try were Metalsmith and Hexo. They require their custom plugins for everything and I don’t understand, why it is better than more generic plugins of Grunt or Gulp.

Next candidate was Jekyll. It has at least twice as more GitHub stars, than second popular solution. It is also default GitHub pages solution. Frankly speaking, Jekyll looks good, but a bit big, so it might be difficult to write own plugins. At that point of time, I wanted to avoid Ruby and try something else.

My final choice was Hugo. It is program, written in Golang, which provides functionality to create, develop and build static website. As advantages I would like to mention:

During development I use develop branch for source code. Hugo builds statis pages in public folder, which is pushed to master branch using git-subtree. You could read about this technique here. To simplify deployment, there is Makefile command with following code:

git add -A
git commit -m "rebuilding site '$(shell date)'"
git push origin develop
git subtree push --prefix=public master

I would like to recommend Hugo for anybody, who wants to build static pages.

comments powered by Disqus