Go templates are lightweight but extensible. Go itself supplies built-in functions, including comparison operators and other basic tools. These are listed in the Go template documentation. Hugo has added additional functions to the basic template logic.
Functions
- abslangurl
- absurl
- adddate
- after
- anchorize
- append
- apply
- base64
- chomp
- complement
- cond
- countrunes
- countwords
- crypto.fnv32a
- dateformat
- default
- delimit
- dict
- duration
- echoparam
- emojify
- eq
- errorf
- fileexists
- findre
- findresubmatch
- first
- float
- format
- ge
- get
- getenv
- getpage
- group
- gt
- hasmenucurrent
- hasprefix
- hassuffix
- highlight
- hmac
- htmlescape
- htmlunescape
- hugo
- humanize
- i18n
- images
- in
- index-function)
- int
- intersect
- ismenucurrent
- isset
- jsonify
- lang.merge
- lang
- last
- le
- len
- lower
- lt
- markdownify
- math
- md5
- merge
- ne
- now
- os.stat)
- param
- partialcached
- path.base
- path.basename
- path.clean
- path.dir
Comments