Building a website doesn’t have to be difficult.
In fact, you can get started in just a few minutes with Hugo (not the movie). Hugo is a static site generator - like Jekyll, written in Go. It’s very fast and easy to use, and perfect for personal websites like this one. This will be a very brief introduction to Hugo, and how to get started with it.
Getting Started
Requirements
- Hugo
- Git
- A text editor (use vscode 😎)
You can fetch the latest version of Hugo from https://gohugo.io/installation/, or install it using your favourite package manager.
MacOS: brew install hugo
Once you’ve got Hugo, make sure you have Git installed. If you don’t have Git, you can install it from https://git-scm.com/downloads.
Creating a new site
Open a terminal and run
hugo new site mysite
If you’re on Windows and you get an error, try adding Hugo to your PATH.
After this, navigate to the newly created directory with
cd mysite
Next, we’ll initialize a git repository and add a theme. You can browse themes at https://themes.gohugo.io/, or use the one I’m using, hugo-profile. For this tutorial, we’ll use the hugo-coder theme, one I previously used for my last site.
git init
git submodule add https://github.com/luizdepra/hugo-coder.git themes/hugo-coder
echo 'theme = "hugo-coder"' >> config.toml
Now, we’re ready to build. Run hugo server
to start a local server. You can view your site at http://localhost:1313.
You can edit the configuration file in the root directory to change the site however you want, and it’ll update live.
Yep, that’s it.