tpl: Add humanize examples to smoke tests
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 14 Jul 2016 18:32:32 +0000 (20:32 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 14 Jul 2016 18:32:32 +0000 (20:32 +0200)
tpl/template_funcs_test.go

index e6c3a78f1f693e09ed8ff6b0b1e352812ba89b19..eeffd46bde0c4cc09ad2d38931ae938b07a6e821 100644 (file)
@@ -93,6 +93,10 @@ eq: {{ if eq .Section "blog" }}current{{ end }}
 findRE: {{ findRE "[G|g]o" "Hugo is a static side generator written in Go." 1 }}
 hasPrefix 1: {{ hasPrefix "Hugo" "Hu" }}
 hasPrefix 2: {{ hasPrefix "Hugo" "Fu" }}
+humanize 1: {{ humanize "my-first-post" }}
+humanize 2: {{ humanize "myCamelPost" }}
+humanize 3: {{ humanize "52" }}
+humanize 4: {{ humanize 103 }}
 in: {{ if in "this string contains a substring" "substring" }}Substring found!{{ end }}
 jsonify: {{ (slice "A" "B" "C") | jsonify }}
 lower: {{lower "BatMan"}}
@@ -145,6 +149,10 @@ eq: current
 findRE: [go]
 hasPrefix 1: true
 hasPrefix 2: false
+humanize 1: My first post
+humanize 2: My camel post
+humanize 3: 52nd
+humanize 4: 103rd
 in: Substring found!
 jsonify: ["A","B","C"]
 lower: batman