Add CurrentURL template variable back (#37444) (#37449)

Backport #37444
This commit is contained in:
wxiaoguang authored and GitHub committed 2026-04-27 21:05:24 +08:00
1 parent cff6eb5661
commit fb3c1b031d
2 files changed
+17

No files matched your search

+1
View File
@@ -165,6 +165,7 @@ func Contexter() func(next http.Handler) http.Handler {
base := NewBaseContext(resp, req)
ctx := NewWebContext(base, rnd, session.GetContextSession(req))
ctx.Data.MergeFrom(middleware.CommonTemplateContextData())
ctx.Data["CurrentURL"] = setting.AppSubURL + req.URL.RequestURI()
ctx.Data["Link"] = ctx.Link
// PageData is passed by reference, and it will be rendered to `window.config.pageData` in `head.tmpl` for JavaScript modules