summaryrefslogtreecommitdiffstats
path: root/hugolib/site.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/site.go')
-rw-r--r--hugolib/site.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/hugolib/site.go b/hugolib/site.go
index d7b5cb64e..bbabf91a3 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -739,7 +739,12 @@ func (s *SiteInfo) Sites() page.Sites {
}
// Current returns the currently rendered Site.
+// If that isn't set yet, which is the situation before we start rendering,
+// if will return the Site itself.
func (s *SiteInfo) Current() page.Site {
+ if s.s.h.currentSite == nil {
+ return s
+ }
return s.s.h.currentSite.Info
}