fork render

This commit is contained in:
Gogs 2014-03-19 21:57:55 +08:00
parent 0da4975f4f
commit 56af7e99a8
13 changed files with 367 additions and 83 deletions

View file

@ -6,7 +6,9 @@ package base
import (
"container/list"
"fmt"
"html/template"
"time"
)
func Str2html(raw string) template.HTML {
@ -40,6 +42,9 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{
"AppDomain": func() string {
return Domain
},
"LoadTimes": func(startTime time.Time) string {
return fmt.Sprint(time.Since(startTime).Nanoseconds()/1e6) + "ms"
},
"AvatarLink": AvatarLink,
"str2html": Str2html,
"TimeSince": TimeSince,