add nocache template func
This commit is contained in:
@@ -62,7 +62,7 @@ var Bytes = map[string]*EmbeddedAsset{
|
||||
0x7b,0x20,0x65,0x6e,0x64,0x20,0x7d,0x7d,0x0a,
|
||||
}},
|
||||
"pages/home.tmpl": &EmbeddedAsset{
|
||||
ModTime: time.Unix(1583972849, 0),
|
||||
ModTime: time.Unix(1583975009, 0),
|
||||
Bytes: []byte{
|
||||
0x7b,0x7b,0x20,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x22,0x75,0x73,0x65,0x72,0x22,0x20,0x7d,0x7d,0x0a,0x3c,0x64,0x69,0x76,
|
||||
0x20,0x63,0x6c,0x61,0x73,0x73,0x3d,0x22,0x70,0x61,0x64,0x64,0x65,0x64,0x20,0x62,0x6f,0x78,0x22,0x3e,0x0a,0x20,0x20,0x20,
|
||||
@@ -390,7 +390,7 @@ var Bytes = map[string]*EmbeddedAsset{
|
||||
0x2f,0x64,0x69,0x76,0x3e,0x0a,0x7b,0x7b,0x20,0x65,0x6e,0x64,0x20,0x7d,0x7d,0x0a,
|
||||
}},
|
||||
"pages/update_lastfm_api_key.tmpl": &EmbeddedAsset{
|
||||
ModTime: time.Unix(1583954426, 0),
|
||||
ModTime: time.Unix(1583975009, 0),
|
||||
Bytes: []byte{
|
||||
0x7b,0x7b,0x20,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x22,0x75,0x73,0x65,0x72,0x22,0x20,0x7d,0x7d,0x0a,0x3c,0x64,0x69,0x76,
|
||||
0x20,0x63,0x6c,0x61,0x73,0x73,0x3d,0x22,0x70,0x61,0x64,0x64,0x65,0x64,0x20,0x62,0x6f,0x78,0x22,0x3e,0x0a,0x20,0x20,0x20,
|
||||
@@ -494,7 +494,7 @@ var Bytes = map[string]*EmbeddedAsset{
|
||||
0x20,0x7d,0x7d,0x0a,
|
||||
}},
|
||||
"static/reset.css": &EmbeddedAsset{
|
||||
ModTime: time.Unix(1583954426, 0),
|
||||
ModTime: time.Unix(1583975009, 0),
|
||||
Bytes: []byte{
|
||||
0x2f,0x2a,0x20,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x6d,0x65,0x79,0x65,0x72,0x77,0x65,0x62,0x2e,0x63,0x6f,0x6d,0x2f,0x65,
|
||||
0x72,0x69,0x63,0x2f,0x74,0x6f,0x6f,0x6c,0x73,0x2f,0x63,0x73,0x73,0x2f,0x72,0x65,0x73,0x65,0x74,0x2f,0x0a,0x20,0x20,0x20,
|
||||
@@ -10803,7 +10803,7 @@ var Bytes = map[string]*EmbeddedAsset{
|
||||
0x55,0x23,0xfe,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
|
||||
}},
|
||||
"static/main.css": &EmbeddedAsset{
|
||||
ModTime: time.Unix(1583954493, 0),
|
||||
ModTime: time.Unix(1583975009, 0),
|
||||
Bytes: []byte{
|
||||
0x3a,0x72,0x6f,0x6f,0x74,0x20,0x7b,0x0a,0x20,0x20,0x2d,0x2d,0x70,0x61,0x64,0x2d,0x73,0x69,0x7a,0x65,0x3a,0x20,0x31,0x2e,
|
||||
0x37,0x35,0x72,0x65,0x6d,0x3b,0x0a,0x7d,0x0a,0x0a,0x2a,0x2c,0x0a,0x73,0x70,0x61,0x6e,0x2c,0x0a,0x64,0x69,0x76,0x2c,0x0a,
|
||||
@@ -10890,7 +10890,7 @@ var Bytes = map[string]*EmbeddedAsset{
|
||||
0x69,0x74,0x61,0x6c,0x69,0x63,0x3b,0x0a,0x7d,0x0a,
|
||||
}},
|
||||
"partials/head.tmpl": &EmbeddedAsset{
|
||||
ModTime: time.Unix(1582000031, 0),
|
||||
ModTime: time.Unix(1583975009, 0),
|
||||
Bytes: []byte{
|
||||
0x7b,0x7b,0x20,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x22,0x68,0x65,0x61,0x64,0x22,0x20,0x7d,0x7d,0x0a,0x3c,0x6c,0x69,0x6e,
|
||||
0x6b,0x20,0x72,0x65,0x6c,0x3d,0x22,0x73,0x74,0x79,0x6c,0x65,0x73,0x68,0x65,0x65,0x74,0x22,0x20,0x68,0x72,0x65,0x66,0x3d,
|
||||
@@ -10902,22 +10902,22 @@ var Bytes = map[string]*EmbeddedAsset{
|
||||
0x72,0x69,0x61,0x6c,0x64,0x65,0x73,0x69,0x67,0x6e,0x69,0x63,0x6f,0x6e,0x73,0x2e,0x6d,0x69,0x6e,0x2e,0x63,0x73,0x73,0x22,
|
||||
0x3e,0x0a,0x3c,0x6c,0x69,0x6e,0x6b,0x20,0x72,0x65,0x6c,0x3d,0x22,0x73,0x74,0x79,0x6c,0x65,0x73,0x68,0x65,0x65,0x74,0x22,
|
||||
0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x7b,0x7b,0x20,0x70,0x61,0x74,0x68,0x20,0x22,0x2f,0x61,0x64,0x6d,0x69,0x6e,0x2f,0x73,
|
||||
0x74,0x61,0x74,0x69,0x63,0x2f,0x6d,0x61,0x69,0x6e,0x2e,0x63,0x73,0x73,0x22,0x20,0x7d,0x7d,0x22,0x3e,0x0a,0x3c,0x6c,0x69,
|
||||
0x6e,0x6b,0x20,0x72,0x65,0x6c,0x3d,0x22,0x73,0x68,0x6f,0x72,0x74,0x63,0x75,0x74,0x20,0x69,0x63,0x6f,0x6e,0x22,0x20,0x68,
|
||||
0x72,0x65,0x66,0x3d,0x22,0x7b,0x7b,0x20,0x70,0x61,0x74,0x68,0x20,0x22,0x2f,0x61,0x64,0x6d,0x69,0x6e,0x2f,0x73,0x74,0x61,
|
||||
0x74,0x69,0x63,0x2f,0x66,0x61,0x76,0x69,0x63,0x6f,0x6e,0x2e,0x69,0x63,0x6f,0x22,0x20,0x7d,0x7d,0x22,0x20,0x74,0x79,0x70,
|
||||
0x65,0x3d,0x22,0x69,0x6d,0x61,0x67,0x65,0x2f,0x78,0x2d,0x69,0x63,0x6f,0x6e,0x22,0x3e,0x0a,0x3c,0x6c,0x69,0x6e,0x6b,0x20,
|
||||
0x72,0x65,0x6c,0x3d,0x22,0x69,0x63,0x6f,0x6e,0x22,0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x7b,0x7b,0x20,0x70,0x61,0x74,0x68,
|
||||
0x20,0x22,0x2f,0x61,0x64,0x6d,0x69,0x6e,0x2f,0x73,0x74,0x61,0x74,0x69,0x63,0x2f,0x66,0x61,0x76,0x69,0x63,0x6f,0x6e,0x2e,
|
||||
0x69,0x63,0x6f,0x22,0x20,0x7d,0x7d,0x22,0x20,0x74,0x79,0x70,0x65,0x3d,0x22,0x69,0x6d,0x61,0x67,0x65,0x2f,0x78,0x2d,0x69,
|
||||
0x63,0x6f,0x6e,0x22,0x3e,0x0a,0x3c,0x6d,0x65,0x74,0x61,0x20,0x6e,0x61,0x6d,0x65,0x3d,0x22,0x76,0x69,0x65,0x77,0x70,0x6f,
|
||||
0x72,0x74,0x22,0x20,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x3d,0x22,0x77,0x69,0x64,0x74,0x68,0x3d,0x64,0x65,0x76,0x69,0x63,
|
||||
0x65,0x2d,0x77,0x69,0x64,0x74,0x68,0x2c,0x20,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x2d,0x73,0x63,0x61,0x6c,0x65,0x3d,0x31,
|
||||
0x2c,0x20,0x75,0x73,0x65,0x72,0x2d,0x73,0x63,0x61,0x6c,0x61,0x62,0x6c,0x65,0x3d,0x6e,0x6f,0x22,0x3e,0x0a,0x7b,0x7b,0x20,
|
||||
0x65,0x6e,0x64,0x20,0x7d,0x7d,0x0a,
|
||||
0x74,0x61,0x74,0x69,0x63,0x2f,0x6d,0x61,0x69,0x6e,0x2e,0x63,0x73,0x73,0x22,0x20,0x7c,0x20,0x6e,0x6f,0x43,0x61,0x63,0x68,
|
||||
0x65,0x20,0x7d,0x7d,0x22,0x3e,0x0a,0x3c,0x6c,0x69,0x6e,0x6b,0x20,0x72,0x65,0x6c,0x3d,0x22,0x73,0x68,0x6f,0x72,0x74,0x63,
|
||||
0x75,0x74,0x20,0x69,0x63,0x6f,0x6e,0x22,0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x7b,0x7b,0x20,0x70,0x61,0x74,0x68,0x20,0x22,
|
||||
0x2f,0x61,0x64,0x6d,0x69,0x6e,0x2f,0x73,0x74,0x61,0x74,0x69,0x63,0x2f,0x66,0x61,0x76,0x69,0x63,0x6f,0x6e,0x2e,0x69,0x63,
|
||||
0x6f,0x22,0x20,0x7d,0x7d,0x22,0x20,0x74,0x79,0x70,0x65,0x3d,0x22,0x69,0x6d,0x61,0x67,0x65,0x2f,0x78,0x2d,0x69,0x63,0x6f,
|
||||
0x6e,0x22,0x3e,0x0a,0x3c,0x6c,0x69,0x6e,0x6b,0x20,0x72,0x65,0x6c,0x3d,0x22,0x69,0x63,0x6f,0x6e,0x22,0x20,0x68,0x72,0x65,
|
||||
0x66,0x3d,0x22,0x7b,0x7b,0x20,0x70,0x61,0x74,0x68,0x20,0x22,0x2f,0x61,0x64,0x6d,0x69,0x6e,0x2f,0x73,0x74,0x61,0x74,0x69,
|
||||
0x63,0x2f,0x66,0x61,0x76,0x69,0x63,0x6f,0x6e,0x2e,0x69,0x63,0x6f,0x22,0x20,0x7d,0x7d,0x22,0x20,0x74,0x79,0x70,0x65,0x3d,
|
||||
0x22,0x69,0x6d,0x61,0x67,0x65,0x2f,0x78,0x2d,0x69,0x63,0x6f,0x6e,0x22,0x3e,0x0a,0x3c,0x6d,0x65,0x74,0x61,0x20,0x6e,0x61,
|
||||
0x6d,0x65,0x3d,0x22,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,0x22,0x20,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x3d,0x22,0x77,
|
||||
0x69,0x64,0x74,0x68,0x3d,0x64,0x65,0x76,0x69,0x63,0x65,0x2d,0x77,0x69,0x64,0x74,0x68,0x2c,0x20,0x69,0x6e,0x69,0x74,0x69,
|
||||
0x61,0x6c,0x2d,0x73,0x63,0x61,0x6c,0x65,0x3d,0x31,0x2c,0x20,0x75,0x73,0x65,0x72,0x2d,0x73,0x63,0x61,0x6c,0x61,0x62,0x6c,
|
||||
0x65,0x3d,0x6e,0x6f,0x22,0x3e,0x0a,0x7b,0x7b,0x20,0x65,0x6e,0x64,0x20,0x7d,0x7d,0x0a,
|
||||
}},
|
||||
"layouts/base.tmpl": &EmbeddedAsset{
|
||||
ModTime: time.Unix(1583954426, 0),
|
||||
ModTime: time.Unix(1583975009, 0),
|
||||
Bytes: []byte{
|
||||
0x7b,0x7b,0x20,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x22,0x6c,0x61,0x79,0x6f,0x75,0x74,0x22,0x20,0x7d,0x7d,0x0a,0x3c,0x21,
|
||||
0x64,0x6f,0x63,0x74,0x79,0x70,0x65,0x20,0x68,0x74,0x6d,0x6c,0x3e,0x0a,0x3c,0x68,0x74,0x6d,0x6c,0x3e,0x0a,0x20,0x20,0x20,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{ define "head" }}
|
||||
<link rel="stylesheet" href="{{ path "/admin/static/reset.css" }}">
|
||||
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/3.6.95/css/materialdesignicons.min.css">
|
||||
<link rel="stylesheet" href="{{ path "/admin/static/main.css" }}">
|
||||
<link rel="stylesheet" href="{{ path "/admin/static/main.css" | noCache }}">
|
||||
<link rel="shortcut icon" href="{{ path "/admin/static/favicon.ico" }}" type="image/x-icon">
|
||||
<link rel="icon" href="{{ path "/admin/static/favicon.ico" }}" type="image/x-icon">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||||
|
||||
@@ -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