About
This page has some not about the hugo website generator.
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
- Start
hugo server -D ^
--themesDir .\hugo\themes ^
--config .\hugo\config.toml ^
--contentDir .\doc
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.
Section
- Section, because first-level dir under content/
- Section, because contains _index.md
Configuration
- toml spec config.toml (if found in the site root) as the default site config file.
- print configuration. hugo config
Image
Relative
https://github.com/gohugoio/hugo/issues/4642
- Do not set baseURL
- Set relativeURLs = “true”
- Set uglyURLs = “true”.
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 }}
Syntax
Support
Note
- Start Hugo with Draft (to not publish future content)
hugo server -D