diff options
Diffstat (limited to 'pkg/template/template.go')
-rw-r--r-- | pkg/template/template.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/pkg/template/template.go b/pkg/template/template.go index eb85ca7b..6d6d09da 100644 --- a/pkg/template/template.go +++ b/pkg/template/template.go @@ -33,6 +33,9 @@ func NewFuncMap() []template.FuncMap { "GoVer": func() string { return strings.Title(runtime.Version()) }, + "Year": func() int { + return time.Now().Year() + }, "UseHTTPS": func() bool { return strings.HasPrefix(setting.AppURL, "https") }, @@ -94,13 +97,13 @@ func NewFuncMap() []template.FuncMap { } return str[start:end] }, - "Join": strings.Join, - "EllipsisString": tool.EllipsisString, - "DiffTypeToStr": DiffTypeToStr, - "DiffLineTypeToStr": DiffLineTypeToStr, - "Sha1": Sha1, - "ShortSHA1": tool.ShortSHA1, - "MD5": tool.MD5, + "Join": strings.Join, + "EllipsisString": tool.EllipsisString, + "DiffTypeToStr": DiffTypeToStr, + "DiffLineTypeToStr": DiffLineTypeToStr, + "Sha1": Sha1, + "ShortSHA1": tool.ShortSHA1, + "MD5": tool.MD5, "ActionContent2Commits": ActionContent2Commits, "EscapePound": EscapePound, "RenderCommitMessage": RenderCommitMessage, |