Install Hugo on Ubuntu to generate static websites
Whilst there is a .DEB installer to download from the GoHugo sites I get all matter of warnings that the package is of bad quality and I am not comfortable to run these kinds of installers.
I rather install from sources in this case which is very straight forward since the main dependencies (largely GO) are in the Ubuntu main repositories.
Install dependencies
sudo apt-get install golang git mercurial python-pygments
Create environment variables
vim ~/.bashrc
#add the following 3 lines export GOROOT=/usr/lib/go export GOPATH=$HOME/go export PATH=$PATH:$GOROOT/bin:$GOPATH/bin`
Update Bash Environment Variables without logging out.
source ~/.bashrc
Install Hugo
go get -u -v github.com/spf13/hugo
Start using Hugo
#create new site
hugo new sitename /path/to/sitename #change directory to site cd /path/to/sitename #create content page hugo new about.md #edit content page vim content/about.md
Comments
Be the first to comment! Reply to this post from your Mastodon/Fediverse or Bluesky account, or mention this post's URL in your reply. Your comment will appear here automatically via webmention.
Follow this blog on Mastodon at @gaggl.com@web.brid.gy or on Bluesky at @gaggl.com
