mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
hugolib: Fix some shortcode vs .Content corner cases
This is a follow-up to #4632. There were some assumptions in that implementation that did not hold water in all situations. This commit simplifies the content lazy initalization making it more robust. Fixes #4664
This commit is contained in:
@@ -180,6 +180,7 @@ func (s *Site) reset() *Site {
|
||||
titleFunc: s.titleFunc,
|
||||
relatedDocsHandler: newSearchIndexHandler(s.relatedDocsHandler.cfg),
|
||||
outputFormats: s.outputFormats,
|
||||
rc: s.rc,
|
||||
outputFormatsConfig: s.outputFormatsConfig,
|
||||
frontmatterHandler: s.frontmatterHandler,
|
||||
mediaTypesConfig: s.mediaTypesConfig,
|
||||
@@ -266,6 +267,7 @@ func newSite(cfg deps.DepsCfg) (*Site, error) {
|
||||
titleFunc: titleFunc,
|
||||
relatedDocsHandler: newSearchIndexHandler(relatedContentConfig),
|
||||
outputFormats: outputFormats,
|
||||
rc: &siteRenderingContext{output.HTMLFormat},
|
||||
outputFormatsConfig: siteOutputFormatsConfig,
|
||||
mediaTypesConfig: siteMediaTypesConfig,
|
||||
frontmatterHandler: frontMatterHandler,
|
||||
@@ -546,7 +548,7 @@ func (s *SiteInfo) RelRef(ref string, page *Page, options ...string) (string, er
|
||||
}
|
||||
|
||||
func (s *Site) running() bool {
|
||||
return s.owner.running
|
||||
return s.owner != nil && s.owner.running
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
Reference in New Issue
Block a user