Skip to content

Hugo Website Framework ​

Prerequisite ​

Install the following:

Go (v1.22+)

jsx
wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go version

NPM

jsx
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.bashrc
nvm install stable
npm version

Install Hugo ​

Download the extended version since a lot of themes require it.

jsx
wget https://github.com/gohugoio/hugo/releases/download/v0.124.1/hugo_extended_0.124.1_linux-amd64.deb
dpkg -i hugo_extended_0.124.1_linux-amd64.deb
hugo version

Download Theme ​

I chose hugo-toha https://github.com/hugo-toha/hugo-toha.github.io

jsx
git clone [https://github.com/hugo-toha/hugo-toha.github.io](https://github.com/hugo-toha/hugo-toha.github.io)

Initialize ​

jsx
# install hugo modules
hugo mod tidy

# install dependencies
hugo mod npm pack
npm install

Run the Server ​

By default the embedded web server will only bind to 127.0.0.1, we wanted to bind to all interfaces.

jsx
hugo server -w --bind 0.0.0.0

References ​

https://themes.gohugo.io/themes/toha/