This package aims to provide an independent implementation of the Hugo template functions. https://gohugo.io/functions/ (view source)
Import the package:
import "github.com/drone/funcmap"
Provide the Funcmap when compiling your templates:
t, err := template.New("_").Funcs(funcmap.Funcs).Parse(text)
base64Decode
base64Encode
jsonify
jsonEncode
jsonDecode
yamlEncode
yamlDecode
append
chomp
contains
containsAny
findRE
firstUpper
hasPrefix
hasSuffix
lower
padLeft
padRight
prepend
repeat
replace
replaceRE
slicestr
split
splitn
title
trim
trimLeft
trimRight
trimPrefix
trimSuffix
upper