diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 55de85646c..023ba60fa9 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -103,6 +103,10 @@ func NewFuncMap() template.FuncMap { "AppVer": func() string { return setting.AppVer }, + "AppVerNoMetadata": func() string { + version, _, _ := strings.Cut(setting.AppVer, "+") + return version + }, "AppDomain": func() string { // documented in mail-templates.md return setting.Domain }, diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl index 5db7464480..133ebac33a 100644 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -8,7 +8,7 @@ {{if .IsAdmin}} {{AppVer}} {{else}} - {{AppVer}} + {{AppVerNoMetadata}} {{end}} {{end}} {{if and .TemplateLoadTimes ShowFooterTemplateLoadTime}} diff --git a/templates/status/404.tmpl b/templates/status/404.tmpl index f9a6e18224..bf6420aef3 100644 --- a/templates/status/404.tmpl +++ b/templates/status/404.tmpl @@ -8,7 +8,7 @@

- {{if .ShowFooterVersion}}

{{ctx.Locale.Tr "admin.config.app_ver"}}: {{AppVer}}

{{end}} + {{if .ShowFooterVersion}}

{{ctx.Locale.Tr "admin.config.app_ver"}}: {{AppVerNoMetadata}}

{{end}} {{template "base/footer" .}}