Skip to content

Instantly share code, notes, and snippets.

@a1300
Last active December 28, 2021 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a1300/a9c5377af0944f39fc779efacb302335 to your computer and use it in GitHub Desktop.
Save a1300/a9c5377af0944f39fc779efacb302335 to your computer and use it in GitHub Desktop.
install hugo and go on server

Install Hugo and Go on Server

# install go
wget https://go.dev/dl/go1.17.5.linux-amd64.tar.gz
tar xzf go1.17.5.linux-amd64.tar.gz
mv go /usr/local
echo 'export PATH=$PATH:/usr/local/go/bin' >> .bashrc
. .bashrc

# hugo extended
wget https://github.com/gohugoio/hugo/releases/download/v0.91.1/hugo_extended_0.91.1_Linux-64bit.deb
sudo dpkg -i hugo_extended_0.91.1_Linux-64bit.deb

Create new site and install theme

mkdir mysite
cd mysite

hugo new site . --force

# clone theme into themes dir
git clone https://github.com/CaiJimmy/hugo-theme-stack themes/hugo-theme-stack

cp themes/hugo-theme-stack/exampleSite/config.yaml .
rm config.toml

# copy content (from example within the theme)
cp -r themes/hugo-theme-stack/exampleSite/content/* content/

# build
hugo

# start hugo server on http://0.0.0.0:1313 (with drafts)
# hugo server --buildDrafts --baseURL "http://0.0.0.0" --bind="0.0.0.0"
hugo server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment