diff options
author | Bjørn Erik Pedersen <[email protected]> | 2021-03-09 10:26:44 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2021-03-09 13:26:39 +0100 |
commit | 18074d0c2375cc4bf4d7933dd4206cb878a23d1c (patch) | |
tree | a244eb41d5d0888494b0003e807a1884f17f4ac8 /hugolib/page.go | |
parent | 35bfb662229226d5f3cc3077ca74323f0aa88b7d (diff) | |
download | hugo-18074d0c2375cc4bf4d7933dd4206cb878a23d1c.tar.gz hugo-18074d0c2375cc4bf4d7933dd4206cb878a23d1c.zip |
Fix output format handling for render hooks
Fixes #8176
Diffstat (limited to 'hugolib/page.go')
-rw-r--r-- | hugolib/page.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index 6c177b687..6099fb21a 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -390,7 +390,7 @@ func (ps *pageState) initCommonProviders(pp pagePaths) error { return nil } -func (p *pageState) createRenderHooks(f output.Format) (*hooks.Renderers, error) { +func (p *pageState) createRenderHooks(f output.Format) (hooks.Renderers, error) { layoutDescriptor := p.getLayoutDescriptor() layoutDescriptor.RenderingHook = true layoutDescriptor.LayoutOverride = false @@ -401,7 +401,7 @@ func (p *pageState) createRenderHooks(f output.Format) (*hooks.Renderers, error) layoutDescriptor.Kind = "render-link" templ, templFound, err := p.s.Tmpl().LookupLayout(layoutDescriptor, f) if err != nil { - return nil, err + return renderers, err } if templFound { renderers.LinkRenderer = hookRenderer{ @@ -414,7 +414,7 @@ func (p *pageState) createRenderHooks(f output.Format) (*hooks.Renderers, error) layoutDescriptor.Kind = "render-image" templ, templFound, err = p.s.Tmpl().LookupLayout(layoutDescriptor, f) if err != nil { - return nil, err + return renderers, err } if templFound { renderers.ImageRenderer = hookRenderer{ @@ -427,7 +427,7 @@ func (p *pageState) createRenderHooks(f output.Format) (*hooks.Renderers, error) layoutDescriptor.Kind = "render-heading" templ, templFound, err = p.s.Tmpl().LookupLayout(layoutDescriptor, f) if err != nil { - return nil, err + return renderers, err } if templFound { renderers.HeadingRenderer = hookRenderer{ @@ -437,7 +437,7 @@ func (p *pageState) createRenderHooks(f output.Format) (*hooks.Renderers, error) } } - return &renderers, nil + return renderers, nil } func (p *pageState) getLayoutDescriptor() output.LayoutDescriptor { |