Go Hugo - Static WebSite Generator

1 - Note

  • Start Hugo with Draft (to not publish future content)
hugo server -D

2 - Installation

  • Download the Windows Release version. For instance hugo_0.42.1_Windows-64bit.zip
  • Extract it to C:\Hugo
  • Add the bin to your PATH
set PATH=%PATH%;C:\Hugo\ 
  • Test it
hugo version
Hugo Static Site Generator v0.42.1 windows/amd64 BuildDate: 2018-06-13T10:17:09Z

3 - Rendering

  • sections are rendered using list.html (or relevant section template). https://gohugo.io/templates/list/
  • {{ .Content }} to render the _index.md file. See Home page content. The _index.md content isn’t a single page. It’s actually still a list page as it’s being rendered at the root of a section.

4 - Section

  • Section, because first-level dir under content/
  • Section, because contains _index.md

5 - Configuration

  • toml spec config.toml (if found in the site root) as the default site config file.
  • print configuration. hugo config

6 - Image

7 - Relative

https://github.com/gohugoio/hugo/issues/4642

  • Do not set baseURL
  • Set relativeURLs = “true”
  • Set uglyURLs = “true”.

8 - Hierarchy

In the layouts/single.html: The below code will override the default title value set in baseof.html; i.e., {{.Site.Title}}

{{ define "title" }}
  {{ .Title }} – {{ .Site.Title }}
{{ end }}

9 - Syntax

10 - Support

hugo.txt · Last modified: 2018/07/18 13:55 by gerardnico