add nocache template func
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -83,6 +84,13 @@ func New(base *ctrlbase.Controller) *Controller {
|
||||
"date": func(in time.Time) string {
|
||||
return strings.ToLower(in.Format("Jan 02, 2006"))
|
||||
},
|
||||
"noCache": func(in string) string {
|
||||
parsed, _ := url.Parse(in)
|
||||
params := parsed.Query()
|
||||
params.Set("v", version.VERSION)
|
||||
parsed.RawQuery = params.Encode()
|
||||
return parsed.String()
|
||||
},
|
||||
"dateHuman": humanize.Time,
|
||||
"path": base.Path,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user