Multilingual Blogging with Hugo - Introduction
Hugo is a tool for building a multilingual static site. Combined with hosting on GitHub, your site will run on zero-budget, and without the hurdles of maintaining any web- or database servers. You will also enjoy the full control over your code.
Hugo allows you to separate writing content (you travel stories, cooking recipes, etc.) from designing your web site. You will need to design a bunch of HTML templates, write your stories, and Hugo will make the two a happy marriage with just a single four-letter word you type in a terminal.
If all you need from your website is to publish your texts and images, and let people comment on these, Hugo will fit the bill perfectly. And finally, once you will need dynamic components less common than Disqus comments, you can do that part using some cloud provider, of which there are plenty.
What This Tutorial is, What it is Not, and How it has Come to Existence.
A friend asked me to help her with a website, and after a quick discussion it was clear that what she needs is a static site generator. So I’ve decided to take Hugo on a test-ride. Since Hugo is, in effect, a content management system, I needed some content to play with, and so I decided to write my notes on Hugo using Hugo itself. And there was a reason to write the notes anyway.
In its niche, as far as the software itself is concerned, Hugo is my favorite of what I’ve tried so far. The documentation is fine for me, but as it often happens with IT professionals, we tend to meticulously document every single tree, forgetting at times to provide some simple path through the forest.
This cookbook-style tutorial provides such a path – from Hugo installation to a functioning multilingual website – without distracting you with the alternatives.
Once the important parts are in place, you should explore the details and the alternatives by reading the official documentation . This tutorial does not attempt to substitute, rather to complement it at best.
Things You Will Likely Need
Install tree
It is a command-line program that outputs a directory sub-tree in a terminal. This is not a requirement, but will come quite handy. On Linux, use your standard package installer. On Mac, use MacPorts . For Windows, see the next section.
Pick a Text Editor
Any editor that doesn’t add its own formatting, will do. This site, for instance, is written entirely (both code and content) with Vim running in a terminal emulator. If you prefer less geeky options, try Atom (works on most popular platforms). There are many more options: Geany, TextWrangler, Notepad++, etc. Don’t use MS Word, OpenOffice Write and the like.
For Windows Users
This entire tutorial is written from UNIX/Linux user’s perspective. Or, rather, from a Bash user’s perspective. Hugo can be used on Windows, so Windows users can still borrow the ideas. Bash commands won’t work, of course, but for the most part these are used just for creating directories and moving files around.
Still, if you want to follow this tutorial to the letter on a Windows machine, there are a couple of options, both implying basic familiarity using UNIX/Linux from command-line:
Linux as a Virtual Machine
Install VirtualBox , and then some Linux desktop as a virtual machine. This will eat up a literally marginal space of your screen.
Linux Subsystem (Windows 10 Only)
With Windows 10, it is possible to install a so-called Linux subsystem on a Windows machine directly. This won’t provide you with a Linux desktop, only the shell environment (Bash by default).