mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Fix more HTMLURL in templates (#22831)
I haven't tested `runs_list.tmpl` but I think it could be right. After this PR, besides the `<meta .. HTMLURL>` in html head, the only explicit HTMLURL usage is in `pull_merge_instruction.tmpl`, which doesn't affect users too much and it's difficult to fix at the moment. There are still many usages of `AppUrl` in the templates (eg: the package help manual), they are similar problems as the HTMLURL in pull_merge_instruction, and they might be fixed together in the future. Diff without space: https://github.com/go-gitea/gitea/pull/22831/files?diff=unified&w=1
This commit is contained in:
@@ -72,6 +72,10 @@ func NewFuncMap() []template.FuncMap {
|
||||
return setting.StaticURLPrefix + "/assets"
|
||||
},
|
||||
"AppUrl": func() string {
|
||||
// The usage of AppUrl should be avoided as much as possible,
|
||||
// because the AppURL(ROOT_URL) may not match user's visiting site and the ROOT_URL in app.ini may be incorrect.
|
||||
// And it's difficult for Gitea to guess absolute URL correctly with zero configuration,
|
||||
// because Gitea doesn't know whether the scheme is HTTP or HTTPS unless the reverse proxy could tell Gitea.
|
||||
return setting.AppURL
|
||||
},
|
||||
"AppVer": func() string {
|
||||
|
Reference in New Issue
Block a user