Hugo Templates

Variables

Custom Variables
Site Title: Acme Corporation
Page Title: Template Page

Data Types
Integer: 2
Float: 3.14
Boolean: false
String: hello

Slice: [foo bar buzz]
Dict: map[h:20 key1:val1 w:10]
Time: 2020-01-01 00:00:00 +0800 +0800

Scratch: {map[message:Hello] {{0 0} 0 0 0 0}}
Getter: Hello
Updated: Hello World
Dict: map[english:Hello World french:Bonjour le monde]

Functions

Boolean Functions 5 < 3 : false
5 > 3 : true
5 ≥ 3 : true
5 ≤ 3 : false
5 = 3 : false
5 ≠ 3 : true

Logical Functions true and false : false
true or false : true
not true : false

Arithmetic Functions 2 + 3 : 5
2 - 3 : -1
2 x 3 : 6
2 ÷ 3 : 0
2 ÷ 3 : 0.6666666666666666
2 % 3 : 2
2 % 3? : false

Nested Functions 5/(2 + (3 x 2.0)) : 0.625

Piped Functions 5/(2 + (3 x 2.0)) : 0.625

Nested + Piped Hybrid 5/(2 + (3 x 2.0)) : 0.625

Conditionals

If false is false.

With test is the value of the condition

Cond page

Loops

All website pages: Range context

Debugging

&hugolib.SiteInfo{Authors:page.AuthorList(nil), Social:hugolib.SiteSocial(nil), hugoInfo:hugo.Info{CommitHash:"f6821b88", BuildDate:"2021-07-30T10:13:35Z", Environment:"production"}, title:"Acme Corporation", RSSLink:"", Author:map[string]interface {}{"email":"contact@example.org", "facebook":"https://facebook.com/example", "hours":"**Mon-Fri:** 9:00AM - 6:00PM, ET", "location":"New York", "name":"Acme Corporation", "phone":"(999) 999-9999", "twitter":"https://twitter.com/example"}, LanguageCode:"en-us", Copyright:"", permalinks:map[string]string{}, LanguagePrefix:"", Languages:langs.Languages{(*langs.Language)(0xc000594630), (*langs.Language)(0xc0005946e0)}, BuildDrafts:false, canonifyURLs:false, relativeURLs:false, uglyURLs:(func(page.Page) bool)(0x138ab80), owner:(*hugolib.HugoSites)(0xc0006c2840), s:(*hugolib.Site)(0xc0003d8000), language:(*langs.Language)(0xc000594630), defaultContentLanguageInSubdir:false, sectionPagesMenu:""}

Image Processing & Manipulation

Original

Resize
Fit
Fill Top
Fill Bottom
Fill center
Fill smart

Brightness -40
ColorBalance 100 200 300
Colorize 200 100 50
Contrast 30
Gamma 3
GaussianBlur 80
Grayscale
Hue 100
Invert
Pixelate 100
Pixelate 100
Saturation 80
Sepia 200
Sigmoid 20 10
UnsharpMask 40 1.2 0.5