How to Create a Website With Hugo
So for some reason, probably boredom without the part of having time, I want to rent a VPS (virtual private server). It’s actually quite cheap, and you can run your own little cloud on it.
So if I already have a server, I might as well create a website. Not that I think a lot of people will actually read it, just for practice. So, how to do it?
I didn’t want to write my own page from scratch. First of all, because it takes tons of work to make it look pretty, and second of all, I’m not a big fan of HTML or CSS. So I started to look for open source static site generators. I came across Hugo, which is written in Go and can use markdown as content source. Markdown is easy, and I work with it regularly since its the standard for a readme. An additional advantage is that Hugo is in the Debian repo, making it less of a hassle to install.
The Quick Start Guide is quite short and helps you to get started with your first post. But for more “advanced” features I found it the easiest to just check the demo code of your theme, since some of the more advanced stuff can depend on your theme. Cool thing: if you add your theme as a git submodule, your entire website can easily be maintained in a single repo, with Hugo as its single dependency to build.
I went with Anatole, because looks just nice (it’s responsive and has an automatic dark mode) and the development is healthy with some outside contributors. On the downside though, it does ship some JS scripts. There are actually themes without JS, which still offer responsiveness and automatic dark mode, like the smol theme. In that particular case I’m not a huge fan of its look though. Maybe I will write my own theme based on it at some point. The nice thing about Hugo is that your content doesn’t depend on the theme, so switching the looks is quite easy.
Writing content is also amazing. Hugo ships can regenerate your website on file changes when running it with hugo server
, so you can have your editor and browser side-by-side, receiving live changes as soon as you save. Exporting it is also easy, with hugo
your website will be exported to public/
(relative to your project folder). Hugo already integrates stuff like tags, categories, menus, etc., so you don’t need to spend time implementing these features which will probably only used by search engines anyway.
It’s easy, and also kinda fun, which is funny because my first attempts at creating a website where the opposite of fun, and Hugo prominently states on their website: “Hugo makes building websites fun again.”