瀏覽代碼

Add current path to the global context

master
Dejan Strbac 4 年之前
committed by Simon Ser
父節點
當前提交
83a5132d15
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: FDE7BE0E88F5E48
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. +4
    -0
      template.go

+ 4
- 0
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{}),


Loading…
取消
儲存