* Add meta author, description and generator tags * Add Hugo version beside the logo and in the footer * Suggest the user to run `go get -u -v` to update dependencies * Requires Go 1.3+ rather than Go 1.1+ * Improve rendering/formatting in some places * Add trailing slash to URLs where appropriate * GitHub redirects all http requests to https, update accordingly
2.1 KiB
aliases | date | linktitle | menu | next | prev | title | weight | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2013-07-01 | Overview |
|
/templates/go-templates | /themes/creation | Hugo Templates | 10 |
Hugo uses the excellent Go html/template library for its template engine. It is an extremely lightweight engine that provides a very small amount of logic. In our experience it is just the right amount of logic to be able to create a good static website.
While Hugo has a number of different template roles, most complete websites can be built using just a small number of template files. Please don’t be afraid of the variety of different template roles. They enable Hugo to build very complicated sites. Most sites will only need to create a /layouts/_default/single.html & /layouts/_default/list.html
If you are new to Go's templates, the Go Template Primer is a great place to start.
If you are familiar with Go’s templates, Hugo provides some additional template functions and variables you will want to be familiar with.
Primary Template roles
There are 3 primary kinds of templates that Hugo works with.
Single
Render a single piece of content
List
Page that list multiple pieces of content
Homepage
The homepage of your site
Supporting Template Roles (optional)
Hugo also has additional kinds of templates all of which are optional
Partial Templates
Common page parts to be included in the above mentioned templates
Content Views
Different ways of rendering a (single) content type
Taxonomy Terms
A list of the terms used for a specific taxonomy, e.g. a Tag cloud
Other Templates (generally unnecessary)
RSS
Used to render all rss documents
Sitemap
Used to render the XML sitemap
404
This template will create a 404.html page used when hosting on GitHub Pages