brew install hugo
which hugo # to verify that it is in my path
Macos Hugo cli setup process
Cli Steps
I installed Hugo on a mac using homebrew. Note, that it is a binary and can be installed by downloading a single file:
Create the Hugo website folder skeleton:
hugo new site creative-portfolio
ls -la
cd creative-portfolio
Grab the creative portfolio theme:
-
from https://themes.gohugo.io/themes/hugo-creative-portfolio-theme/
-
using the download button to go to github url
-
then on your harddrive, go to the Hugo skeleton root folder and then:
cd themes/
git clone https://github.com/kishaningithub/hugo-creative-portfolio-theme.git
rm -rf hugo-creative-portfolio-theme/.git
cd .. # to go back to the Hugo skeleton root
Since I had the asciidoc files already, I will copy them into the new sites posts folder using the window manager.
-
the files will be placed into hugo_skeleton_root/content/posts
-
if the posts folder doesn’t exists in content, create it
I had to modify the config.toml file to know how to use asciidoc using asciidoctor as the compiler/transpiler. I installed asciidoctor using:
brew install asciidoctor
which asciidoctor # to verify that it is in my path
Configs to add:
[security] enableInlineShortcodes = false [security.exec] allow = ["^dart-sass-embedded$", "^go$", "^npx$", "^postcss$", "^asciidoctor$"] osEnv = ["(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM|RUBYLIB)$"] [security.funcs] getenv = ["^HUGO_"] [security.http] methods = ["(?i)GET|POST"] urls = [".*"]
Test by starting the Hugo interactive server:
hugo server
Start building sites …
hugo v0.111.3-5d4eb5154e1fed125ca8e9b5a0315c4180dab192 darwin/amd64 BuildDate=2023-03-12T11:40:50Z VendorInfo=gohugoio
| EN
-------------------+-----
Pages | 37
Paginator pages | 0
Non-page files | 0
Static files | 1
Processed images | 0
Aliases | 2
Sitemaps | 1
Cleaned | 0
Built in 1226 ms
Watching for changes in /Volumes/people/web-dev/ananke/{archetypes,assets,content,data,layouts,static,themes}
Watching for config changes in /Volumes/people/web-dev/ananke/config.toml, /Volumes/people/web-dev/ananke/themes/ananke/config.yaml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at //localhost:1313/~m3griffi/ (bind address 127.0.0.1)
Press Ctrl+C to stop
The url can now be loaded into to your browser by adding 'http:' to the given string.
To compile to full static pages for a web server, I will be using Erick’s compile flag tips - https://www.eng.uwaterloo.ca/~erick/public/hugo/, to my engineering tilde site location. In config.toml modify or add:
baseURL = '//www.eng.uwaterloo.ca/~m3griffi/' RelativeURLs=true CanonifyURLs=true
Now, on the cli, in the Hugo skeleton folder:
hugo --noBuildLock -D -b="https://www.eng.uwaterloo.ca/~m3griffi/public_html"
chmod -R 0755 public/*
Finally, copy these files to your permanent web server location.