You need a computer for this part, once. After the site is on GitHub, Blograker and GitHub handle publishing and your computer is optional. Already have a Hugo site on GitHub? Skip to Turn on GitHub Pages.
Install Hugo, Git and the GitHub CLI
Install the extended edition of Hugo. Most themes need it to compile their stylesheets. The GitHub CLI (gh) signs Git in to your account, so you never have to create an access token by hand.
macOS, with Homebrew:
brew install hugo git gh
Windows, in PowerShell or Terminal:
winget install Hugo.Hugo.Extended
winget install Git.Git
winget install GitHub.cli
Close and reopen the terminal afterwards so it finds the new commands.
Linux: sudo snap install hugo installs the extended edition. Avoid the apt package on Debian and Ubuntu, which is often years out of date; download a .deb from Hugo’s releases page instead. Install git from your package manager, and gh from cli.github.com.
Check the install:
hugo version
The output should include +extended. Note the version number (for example 0.166.0); the deployment action uses the same one so the site builds identically on GitHub.
Sign in to GitHub
gh auth login
Choose GitHub.com, then HTTPS, answer Yes to authenticating Git with your GitHub credentials, and log in with a web browser.
Create the site
hugo new site myblog
cd myblog
git init -b main
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo "theme = 'ananke'" >> hugo.toml
That makes a folder called myblog with Hugo’s standard layout and adds Ananke, the theme Hugo’s own quick start uses. You can swap it for any theme on themes.gohugo.io later. Themes are added as Git submodules: a pointer to the theme’s own repo, which the deployment action fetches when it builds.
Open hugo.toml and give the site a title:
title = 'My Blog'
Write a first post and preview it
hugo new content posts/hello.md
Open content/posts/hello.md, write a line or two under the front matter, and change draft = true to draft = false. Then start the preview server:
hugo server
Open localhost:1313. The page reloads as you edit. Press Ctrl-C to stop the server.
Push it to GitHub
Tell Git to skip the files Hugo generates. Create a file named .gitignore in the myblog folder containing:
/public/
/resources/_gen/
.hugo_build.lock
Commit everything and create the repo in one step:
git add .
git commit -m "First commit"
gh repo create myblog --public --source=. --remote=origin --push
Use --private instead of --public if you chose a private repo.