Skip to content

Instantly share code, notes, and snippets.

@a1300
Last active December 28, 2021 23:27
Show Gist options
  • 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