Install Hugo on WSL
Static websites have become popular over the years for its speed, simplicity, and low to no cost hosting.
Elevator pitch on Static vs. Dynamic
When you go online and check your Gmail (or if you are my dad, your Hotmail) account, the site is generated dynamically for you, that means it changes depending on day/time or in this case the user. Its usually controlled by an application server and some database.
On the other hand a static site (like this one 😄) it is delivered to the user exactly as it is stored, it displays the same information for all users. It usually contains some HTML
,CSS
& JS
files
In this tutorial, we will install a popular static website generator called Hugo. Hugo is a static site generator written in go, and it is fantastic.
Requirements
- Windows Linux Subsystem, with Ubuntu as distribution ( vanilla Ubuntu will work)
- Golang installed, preferably
1.11
or higher.
Download package
To get the latest package, we need to go to https://github.com/gohugoio/hugo/releases/ and select a compatible version. Since we are on an Unbutu/Debian distribution we will choose hugo_0.54.0_Linux-64bit.deb
, to save on typing a long link address, right click and copy link address.
Open your terminal and type wget
and paste the link
wget https://github.com/gohugoio/hugo/releases/download/v0.54.0/hugo_0.54.0_Linux-64bit.deb
wget
stands for “web get”. It is a command-line utility which downloads files over a network.
Extract package
Now we will extract the package, make sure you type sudo
.
$ sudo dpkg -i hugo_0.54.0_Linux-64bit.deb
[sudo] password for salas:
Selecting previously unselected package hugo.
(Reading database ... 28572 files and directories currently installed.)
Preparing to unpack hugo_0.54.0_Linux-64bit.deb ...
Unpacking hugo (0.54.0) ...
Setting up hugo (0.54.0) ...
The Debian package
dpkg
provides the dpkg program, is used to install, remove, and provide information about .deb packages.flag:
-i
: install
Verify
Now let’s check if it is installed correctly.
$ hugo version
Hugo Static Site Generator v0.54.0-B1A82C61 linux/amd64 BuildDate: 2019-02-01T09:40:34Z