What is HUGO?
In this article, we are going to learn about HUGO static website generator.
- What is HUGO?
- How to install HUGO?
What is HUGO?
HUGO is a static site generator (SSG) which, as the name suggests, you can use to make static websites and blogs.
Before we go deeper into HUGO, we need to understand these two terms mentioned in this definition of HUGO, i.e. what is a static website and what are static site generators.
If you do not know what static sites or static site generators (SSGs) are, you may read about them here.
It is based on the GO language developed by Google. Though you need not have much knowledge of this language to make a site using HUGO. We can just use a theme.
Maybe sometimes you may have to change a few things here and there. That can be managed. And I will guide you to some extent in this effort of yours.
As HUGO is an open-source static site generator, we can do a lot of customizations and even build our own themes.
Though we use markup language in HUGO to create our pages and posts, we can use simple HTML, CSS, and JavaScript too. You just need a code editor, e.g. Visual Studio Code (VSS), Sublime Text, etc.
How to install HUGO?
There are various ways to install HUGO. You may check them out here.
However, here we will learn how to install HUGO on Windows operating system, using Chocolatey.
So, before installing HUGO you need to install Chocolatey.
Installing Chocolatey
Command to install chocolatey:
To read more about it you may refer this website.
Chocolatey (Windows) - It can be installed when you install node.js. It’s offered to you as an optional feature when you are installing node.
However, I installed the latest version of Nodejs recently and checked the install chocolatey checkbox too during its installation but still chocolatey was not installed. It was probably because of the restricted execution policy of scripts.
So, I installed chocolatey separately by referring the instructions given on its website. This link can also be accessed from chocolatey installation guide of Hugo.
I used the windows powershell as admin to install it. But once installed we can use it on command prompt too.
Once this is done, you may go ahead and install HUGO now.
Installing HUGO
If you are on a Windows machine and use Chocolatey for package management, you can install Hugo with the following one line command:
If you need the “extended” Sass/SCSS version of HUGO, use the following command:
I used windows command prompt (cmd) for this purpose. However, make sure you open cmd as Admin.
You need to check the requirements of your HUGO theme to decide which version of HUGO you need to install. Most HUGO themes mention it explicitly. However, in case of any doubt install the extended version. That’s what I do too.
Another way to install Hugo on windows 10 is given on this website. It is for people who do not have chocolatey installed.
Check HUGO Version
Once you have installed HUGO, you may check its version using the following command: