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 ourgolocal environment:cd ~/ mkdir go cd go mkdir bin mkdir pkg mkdir src cd src mkdir github.comLet’s install
hugovia this command:cd ~/go/src/github.com/ mkdir gohugoio cd gohugoio git clone https://github.com/gohugoio/hugo.git cd hugo go installConfirm our
hugoapplication has been installed:$GOPATH/bin/hugoOnce 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 bartmikaCreate 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
hugoproject. 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-hugoCreate your first post.
$GOPATH/bin/hugo new posts/hello-world.mdCopy 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 servercommand which will generate the site and run it. Please note everytime you make a change in your any file thehugoserver will hotreload the site with your latest content. Also note the-Dflag enables draft articles which you are writing to be displayed on the site:hugo server -DOpen 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.
