Learn how to work effectively with Hugo static site generator.

Installation#

Hugo can be installed on various platforms:

  • macOS: brew install hugo
  • Linux: Download from releases or use package manager
  • Windows: Use Chocolatey or download binary

Basic Commands#

Create a new site#

hugo new site mysite

Add a theme#

git submodule add https://github.com/panr/hugo-theme-terminal.git themes/terminal

Create content#

hugo new posts/my-post.md

Start development server#

hugo server -D

Directory Structure#

.
├── archetypes/
├── content/
├── data/
├── layouts/
├── public/
├── static/
├── themes/
└── hugo.toml

Tips and Tricks#

  1. Use hugo server --buildDrafts to see draft posts
  2. Add --disableFastRender for complete rebuilds
  3. Use shortcodes for reusable content
  4. Customize themes by overriding templates in layouts/

Happy blogging!