aboutsummaryrefslogtreecommitdiffstats
path: root/modules/templates
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2022-08-25 08:16:20 +0200
committerGitHub <noreply@github.com>2022-08-25 07:16:20 +0100
commit85f829fb3c631349ffc64d5f375e445b8855088c (patch)
treedf5a85848f5f20975ad264e02b0d3059610d2b27 /modules/templates
parent5ebd26d306c59800699fe506ebe742b43345f715 (diff)
downloadgitea-85f829fb3c631349ffc64d5f375e445b8855088c.tar.gz
gitea-85f829fb3c631349ffc64d5f375e445b8855088c.zip
Enable contenthash in filename for dynamic assets (#20813) (#20932)
This should solve the main problem of dynamic assets getting stale after a version upgrade. Everything not affected will use query-string based cache busting, which includes files loaded via HTML or worker scripts.
Diffstat (limited to 'modules/templates')
-rw-r--r--modules/templates/helper.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index ad39baecb9..e78dcb61cf 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -81,6 +81,9 @@ func NewFuncMap() []template.FuncMap {
"AppDomain": func() string {
return setting.Domain
},
+ "AssetVersion": func() string {
+ return setting.AssetVersion
+ },
"DisableGravatar": func() bool {
return setting.DisableGravatar
},
@@ -151,7 +154,6 @@ func NewFuncMap() []template.FuncMap {
"DiffTypeToStr": DiffTypeToStr,
"DiffLineTypeToStr": DiffLineTypeToStr,
"ShortSha": base.ShortSha,
- "MD5": base.EncodeMD5,
"ActionContent2Commits": ActionContent2Commits,
"PathEscape": url.PathEscape,
"PathEscapeSegments": util.PathEscapeSegments,