Hugo - My First Post - Using Hugo with GitHub Pages
Published: Hugo Estimated reading time: ~1 minutes
This is my first Hugo/GitHub Pages post. And here is how it was done.
Initial setup
Install Chocolatey
- Open Elevated PowerShell prompt
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Install Hugo using Chocolatey
- From Elevated PowerShel prompt
choco install hugo
Create a GitHub repo to host your site
Create a Hugo Static site in a local folder
hugo new site mySubdomain.myDomain.com
Use the Hugo quickstart guide to fill in the blanks https://gohugo.io/getting-started/quick-start/
Make sure to add a theme!
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke;\ echo 'theme = "ananke"' >> config.toml
Add a post
hugo new posts/my-first-post.md
Edit the .toml file to fix it up for GitHub https://gohugo.io/hosting-and-deployment/hosting-on-github/
publishDir = "docs"
baseURL = "http://blog.lukebtaylor.com/"
Start the Hugo server locally with drafts enabled
hugo server -D
Build with Hugo
hugo
Add the static site folder to Git
git add --all
Commit the changes
git commmit -m "my first hugo post"
Push it to Git
git push -u origin master
Get up the repo as a GitHub Page
Set up DNS to point to new repo
End
Adding content
Add your content using Hugo
Rebuild using
hugo
When you’re satisfied
git add --all
git commit -m "I made a new post"
git push -u origin master
Next Steps
Automated builds with Travis CI