diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/templates/helper.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go index c256455399..f65b8c6856 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -117,6 +117,17 @@ func NewFuncMap() []template.FuncMap { } return "tab-size-8" }, + "SubJumpablePath": func(str string) []string { + var path []string + index := strings.LastIndex(str, "/") + if index != -1 && index != len(str) { + path = append(path, string(str[0:index+1])) + path = append(path, string(str[index+1:])) + } else { + path = append(path, str) + } + return path + }, }} } |