1
0
Fork 0
forked from forgejo/forgejo

refactor PageData to pageData

This commit is contained in:
wxiaoguang 2021-10-14 18:12:40 +08:00
parent b0c049427b
commit f1eb3784d0
7 changed files with 9 additions and 9 deletions

View file

@ -51,7 +51,7 @@ type Context struct {
Resp ResponseWriter
Req *http.Request
Data map[string]interface{} // data used by MVC templates
PageData map[string]interface{} // data used by JavaScript modules in one page
PageData map[string]interface{} // data used by JavaScript modules in one page, it's `window.config.pageData`
Render Render
translation.Locale
Cache cache.Cache
@ -648,7 +648,7 @@ func Contexter() func(next http.Handler) http.Handler {
"IsProd": setting.IsProd(),
},
}
// PageData is passed by reference, and it will be rendered to `window.config.PageData` in `head.tmpl` for JavaScript modules
// PageData is passed by reference, and it will be rendered to `window.config.pageData` in `head.tmpl` for JavaScript modules
ctx.PageData = map[string]interface{}{}
ctx.Data["PageData"] = ctx.PageData