Hugo Update
Make sure you install latest version
Debian-based: apt hugo update
<or>
Fedora-based: dnf hugo update
Setup Hugo Site
- Open Terminal
- To create a new site, select a location for the site source code
hugo new site <site-name>
- Change directory into site-name you created and create a directory structure with the following elements:
├── archetypes
├── config
├── content
├── data
├── layouts
├── resources
├── static
└── themes
For detailed explaination of directory structure: Official Hugo Docs
Add themes
Cloning repository
git clone https://github.com/username/hugo-theme-name.git
To update the theme:
cd themes/Hugo-Theme-Name
git pull
Use as Submodule
git submodule add https://github.com/username/hugo-theme-name.git themes/Hugo-Theme-Name
git submodule update --init --recursive
To update the theme:
git submodule update --remote --merge
Download as Zip
- Download as a zip from GitHub or GitLab repository
- Then Extract into Themes directory
Then read themes README.md to learn how to use that theme.
Add theme name in Config.toml or Config.yml
Hugo server
- Hugo comes with LiveReload built in. There are no additional packages to install.
- A common way to use Hugo while developing a site is to have Hugo run a server with the hugo server command and watch for changes:
hugo server
0 draft content
0 future content
99 pages created
0 paginator pages created
16 tags created
0 groups created
in 120 ms
Watching for changes in /Users/yourname/sites/yourhugosite/
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop