mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
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
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user