The purpose of this article is to help beginners understand how to do the advanced install of hugo
static site generator (SSG).
Introduction
In the previous articles I wrote them under the assumption that the user was for MacOS or Linux, but what about Windows? If you are a Windows user then this article is for you!
Instructions
Go to the following link and download the latest version of Golang programming language. When this article was written we installed version 1.15.2.
Once you download the file, install the executable and you’ll have Golang ready on your system.
Go the following link and download the latest version of Git. When this article was written we installed version 2.28.0.
Once you download the file, install the executable and you’ll have Git ready on your system.
Click Start in the menu and search for the keyword Git Bash, once you find it please click on the application.
You should see the terminal loaded up.
Before we install
hugo
, we will need to setup ourgo
local environment:cd ~/ mkdir go cd go mkdir bin mkdir pkg mkdir src cd src mkdir github.com
Let’s install
hugo
via this command:cd ~/go/src/github.com/ mkdir gohugoio cd gohugoio git clone https://github.com/gohugoio/hugo.git cd hugo go install
Confirm our
hugo
application has been installed:$GOPATH/bin/hugo
Once confirmed you are ready to continue! The next few sections we will create the folder of our GitHub username, my username is “bartmika” so I am writing with it, please use your own username and follow along:
cd ~/go/src/github.com mkdir bartmika cd bartmika
Create our site. My recommendation is use the format “your-domain” + “-hugo” were “your-domain” is the name of your website and “-hugo” indicates this is a
hugo
project. Please note, my website domain is bartlomiejmika.com so I will be writing with “bartlomiejmika-hugo” with the following:$GOPATH/bin/hugo new site bartlomiejmika-hugo cd bartlomiejmika-hugo
Create your first post.
$GOPATH/bin/hugo new posts/hello-world.md
Copy the contents from this sample post file into your file located at
content/posts/hello-world.md
.Let’s confirm our site works by running the
hugo server
command which will generate the site and run it. Please note everytime you make a change in your any file thehugo
server will hotreload the site with your latest content. Also note the-D
flag enables draft articles which you are writing to be displayed on the site:hugo server -D
Open your browsers and visit http://localhost:1313/ to view your site. If something appears then congratulations you have setup your site! The next step is you’ll need to look through the project and spend time customizing it.
Thank you for reading, if you want to learn how create a website with a beautiful theme then please another article I’ve written titled “How to Start a Personal Blog With Hugo a Static Site Generator Written in Go”.
Before I finish, I’d like to say if you like the open source hugo
project please add a star to show your support and if you really appreciate it then please consider sponsoring.
See also
- How to Containerize a Golang App With Docker for Development and Production
- How to Write a Golang App Remotely on a Raspberry Pi Using Atom
- How to Perform RSA Encryption in Javascript (React.js) and Golang
- Quickstart to Building Golang Apps using IPFS
- Docker Learning Resources for Absolute Beginners Programming With Golang