How to set up the hugo

February 2017 · 1 minute read
  • Share

hugo-logo

What’s Hugo?

It’s a static site generator written in Golang. As a similar static site generator, Jekyll, Middleman, etc. There are 3 major reasons for choosing Hugo:

Install the hugo.

If you are using a Mac.

$ brew install hugo

Create a site.

$ hugo new site ${site_name}

Install some theme.

$ mkdir themes
$ cd themes
$ git submodule add https://github.com/${user_id}/${repos_name}.git

Post articles.

$ hugo new ${article_name.md}

Preview site.

$ hugo server -t ${theme_name} -w

Generate a page.

$ hugo -t ${theme_name}

Configuration

theme = "${theme_name}" # Apply theme.
canonifyurls = true # It's absolute path based on baseurl, not a relative path.
publishDir = "${dir_path}" # Directory path to publish

Thanks!

comments powered by Disqus