Add current path to the global context
This commit is contained in:
parent
15a77185b4
commit
83a5132d15
1 changed files with 4 additions and 0 deletions
|
@ -14,6 +14,8 @@ const themesDir = "themes"
|
|||
|
||||
// GlobalRenderData contains data available in all templates.
|
||||
type GlobalRenderData struct {
|
||||
Path string
|
||||
|
||||
LoggedIn bool
|
||||
|
||||
// if logged in
|
||||
|
@ -70,6 +72,8 @@ func NewBaseRenderData(ctx *Context) *BaseRenderData {
|
|||
global.Username = ctx.Session.username
|
||||
}
|
||||
|
||||
global.Path = ctx.Request().URL.String()
|
||||
|
||||
return &BaseRenderData{
|
||||
GlobalData: global,
|
||||
Extra: make(map[string]interface{}),
|
||||
|
|
Loading…
Reference in a new issue