summaryrefslogtreecommitdiffstats
path: root/resources/page
diff options
context:
space:
mode:
Diffstat (limited to 'resources/page')
-rw-r--r--resources/page/site.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/resources/page/site.go b/resources/page/site.go
index 56f438cb6..9f7871a02 100644
--- a/resources/page/site.go
+++ b/resources/page/site.go
@@ -134,6 +134,12 @@ type Site interface {
// Deprecated: Use .Site.Home.OutputFormats.Get "rss" instead.
RSSLink() template.URL
+
+ // For internal use only.
+ // This will panic if the site is not fully initialized.
+ // This is typically used to inform the user in the content adapter templates,
+ // as these are executed before all the page collections etc. are ready to use.
+ CheckReady()
}
// Sites represents an ordered list of sites (languages).
@@ -326,6 +332,11 @@ func (s *siteWrapper) ForEeachIdentityByName(name string, f func(identity.Identi
s.s.(identity.ForEeachIdentityByNameProvider).ForEeachIdentityByName(name, f)
}
+// For internal use only.
+func (s *siteWrapper) CheckReady() {
+ s.s.CheckReady()
+}
+
type testSite struct {
h hugo.HugoInfo
l *langs.Language
@@ -480,6 +491,9 @@ func (s testSite) RSSLink() template.URL {
return ""
}
+func (s testSite) CheckReady() {
+}
+
// NewDummyHugoSite creates a new minimal test site.
func NewDummyHugoSite(conf config.AllProvider) Site {
return testSite{