Home πŸ‡ΊπŸ‡¦ Support Ukraine

Hugo Cheatsheet

Created: 2019-09-01

Reading time: 1 min


Following Mike Dane’s Static Site Generator tutorial @ youtube.

Installing hugo

git clone https://github.com/gohugoio/hugo.git
cd hugo
go install --tags extended

Add ~/go/bin to $PATH

4. Create a new site

hugo new site test

5. Install a Theme

NOTE: theme repo: https://themes.gohugo.io

cd test/themes
git clone 'https://github.com/giraffeacademy/ga-hugo-theme.git'
cd ..

Edit config.toml adding: theme = "ga-hugo-theme"

Test the site: hugo server

6. Creating and organizing content

hugo new a.md creates a.md skeleton file inside content directory.

To create a file inside a subdirectory, run: hugo new dir/b.md.

View created files: hugo server -D. -D for viewing drafts.

Hugo automatically creates list template files for top level directories. If you want to have a listing for nested directory, create an _index.md file in it.