Hugo Templates

My tests

Params.listthumbvisible:
.Site.Params.listthumbvisible: true
default listthumbvisible true

.Params.mathjax:
.Site.Params.mathjax: false
default mathjax false

Page contents

This is a test page that uses it’s own page template to display GoHugo template functions and variables. The page really just exists to trigger the use of the template.

Here we go:

Variables

Custom Variables
Site Title: It's All Downhill From Here
Page Title: Test Page to play with Hugo template functions
Page Kind: page
Page Type: template-playground
Page BundleType:
Page Section: template-playground
Page Layout:
Page Date: 2024-12-19 00:00:00 +0000 UTC

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

&page.siteWrapper{s:(*hugolib.Site)(0xc000003c80)}