summaryrefslogtreecommitdiffstats
path: root/hugolib/page.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-11-26 10:11:22 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-12-06 14:37:25 +0100
commit831d23cb4d1ca99cdc15ed31c8ee1f981497be8f (patch)
tree8fe47b1b1b9233448297f8015ce61bbb7da13fc7 /hugolib/page.go
parent514e18dc27ce37a0e9a231741d616cf29d50d610 (diff)
Add tpl/site and tpl/hugo
This means that the current `.Site` and ´.Hugo` is available as a globals, so you can do `site.IsServer`, `hugo.Version` etc. Fixes #5470 Fixes #5467 Fixes #5503
Diffstat (limited to 'hugolib/page.go')
-rw-r--r--hugolib/page.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/hugolib/page.go b/hugolib/page.go
index f3e87be7d..4c48a6061 100644
--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -21,6 +21,8 @@ import (
"math/rand"
"reflect"
+ "github.com/gohugoio/hugo/common/hugo"
+
"github.com/gohugoio/hugo/common/maps"
"github.com/gohugoio/hugo/common/urls"
"github.com/gohugoio/hugo/media"
@@ -1873,8 +1875,8 @@ func (p *Page) copy(initContent bool) *Page {
return &c
}
-func (p *Page) Hugo() *HugoInfo {
- return hugoInfo
+func (p *Page) Hugo() hugo.Info {
+ return p.s.Info.hugoInfo
}
// GetPage looks up a page for the given ref.