mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Don't store assets modified time into generated files (#18193)
This commit is contained in:
@@ -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))
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user