What is hugo

Hugo is one of the most popular open-source static site generators.

https://gohugo.io/

How to use hugo?

Start a localhost server

hugo server

Start server with specific theme

hugo server -t <theme-name>

<themes-name> should under theme folder

Start server with draft posts

hugo server -D

Start server with specific environment configuration

hugo --environment production server

Generate a static website

hugo

All content will be generated under public folder

Create a new post

hugo new technote/hugo-note.md

New post template

  1. archetypes/posts.md
  2. archetypes/default.md
  3. themes/<theme-name>/archetypes/posts.md
  4. themes/<theme-name>/archetypes/default.md

https://gohugo.io/content-management/archetypes/

Theme

Path: themes/<theme-name>

Most time need to fix in themes/<theme-name>/layouts/_default

https://gohugo.io/templates/introduction/

Reference

https://gohugo.io/getting-started/quick-start/