aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDejan Strbac <me@dejanstrbac.com>2020-01-16 13:36:03 +0100
committerSimon Ser <contact@emersion.fr>2020-01-16 13:36:03 +0100
commit83a5132d150e0db18653b5c90b9aff003fb02c68 (patch)
treedf64d0835f3bcd1ebbb701d05b327bea9d66eb61
parent15a77185b48515c5d66165f04c94ad6037f8c644 (diff)
downloadalps-83a5132d150e0db18653b5c90b9aff003fb02c68.tar.gz
alps-83a5132d150e0db18653b5c90b9aff003fb02c68.zip
Add current path to the global context
-rw-r--r--template.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/template.go b/template.go
index dfb9a97..97a356c 100644
--- a/template.go
+++ b/template.go
@@ -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{}),