mirror of https://github.com/mickael-menu/zk
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
378 B
Go
18 lines
378 B
Go
4 years ago
|
package helpers
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
|
||
|
"github.com/aymerick/raymond"
|
||
|
)
|
||
|
|
||
|
// RegisterJoin registers a {{join}} template helper which concatenates list
|
||
|
// items with the given separator.
|
||
|
//
|
||
|
// {{join list ', '}} -> item1, item2, item3
|
||
|
func RegisterJoin() {
|
||
|
raymond.RegisterHelper("join", func(list []string, delimiter string) string {
|
||
|
return strings.Join(list, delimiter)
|
||
|
})
|
||
|
}
|