Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tpl
diff options
context:
space:
mode:
authorTom Helmer Hansen <tom@adapt.dk>2015-01-16 23:18:19 +0300
committerbep <bjorn.erik.pedersen@gmail.com>2015-01-18 16:54:26 +0300
commit871e811339b660232557dca10a6d181a5320d745 (patch)
tree239d8af69a38abf2d706f08bc368b2d4de078690 /tpl
parent32d15d91fc8df7fa9f1f53d22c086c7ea43da9f0 (diff)
Add trim and replace template functions
Diffstat (limited to 'tpl')
-rw-r--r--tpl/template.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/tpl/template.go b/tpl/template.go
index a051eba0b..f392f81f0 100644
--- a/tpl/template.go
+++ b/tpl/template.go
@@ -1237,6 +1237,8 @@ func init() {
"relref": RelRef,
"apply": Apply,
"chomp": Chomp,
+ "replace": func(a string, b string, c string) string { return strings.Replace(a, b, c, -1) },
+ "trim": func(a string, b string) string { return strings.Trim(a, b) },
}
chompRegexp = regexp.MustCompile("[\r\n]+$")