summaryrefslogtreecommitdiffstats
path: root/modules/templates
diff options
context:
space:
mode:
Diffstat (limited to 'modules/templates')
-rw-r--r--modules/templates/static.go7
-rw-r--r--modules/templates/templates_bindata.go2
2 files changed, 8 insertions, 1 deletions
diff --git a/modules/templates/static.go b/modules/templates/static.go
index fdd68c1e6a..c2295b2bd8 100644
--- a/modules/templates/static.go
+++ b/modules/templates/static.go
@@ -15,9 +15,11 @@ import (
"path/filepath"
"strings"
texttmpl "text/template"
+ "time"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
+ "code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
)
@@ -26,6 +28,11 @@ var (
bodyTemplates = template.New("")
)
+// GlobalModTime provide a gloabl mod time for embedded asset files
+func GlobalModTime(filename string) time.Time {
+ return timeutil.GetExecutableModTime()
+}
+
// GetAsset get a special asset, only for chi
func GetAsset(name string) ([]byte, error) {
bs, err := os.ReadFile(filepath.Join(setting.CustomPath, name))
diff --git a/modules/templates/templates_bindata.go b/modules/templates/templates_bindata.go
index 887f9eeba2..95f71d0042 100644
--- a/modules/templates/templates_bindata.go
+++ b/modules/templates/templates_bindata.go
@@ -7,4 +7,4 @@
package templates
-//go:generate go run -mod=vendor ../../build/generate-bindata.go ../../templates templates bindata.go
+//go:generate go run -mod=vendor ../../build/generate-bindata.go ../../templates templates bindata.go true