mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
Fix .Fragments when called cross sites on uninitialized output format
Fixes #10794
This commit is contained in:
@@ -342,6 +342,19 @@ func (p *pageContentOutput) Reset() {
|
||||
p.renderHooks = &renderHooks{}
|
||||
}
|
||||
|
||||
func (p *pageContentOutput) Fragments(ctx context.Context) *tableofcontents.Fragments {
|
||||
p.p.s.initInit(ctx, p.initToC, p.p)
|
||||
if p.tableOfContents == nil {
|
||||
return tableofcontents.Empty
|
||||
}
|
||||
return p.tableOfContents
|
||||
}
|
||||
|
||||
func (p *pageContentOutput) TableOfContents(ctx context.Context) template.HTML {
|
||||
p.p.s.initInit(ctx, p.initToC, p.p)
|
||||
return p.tableOfContentsHTML
|
||||
}
|
||||
|
||||
func (p *pageContentOutput) Content(ctx context.Context) (any, error) {
|
||||
p.p.s.initInit(ctx, p.initMain, p.p)
|
||||
return p.content, nil
|
||||
@@ -380,11 +393,6 @@ func (p *pageContentOutput) Summary(ctx context.Context) template.HTML {
|
||||
return p.summary
|
||||
}
|
||||
|
||||
func (p *pageContentOutput) TableOfContents(ctx context.Context) template.HTML {
|
||||
p.p.s.initInit(ctx, p.initMain, p.p)
|
||||
return p.tableOfContentsHTML
|
||||
}
|
||||
|
||||
func (p *pageContentOutput) Truncated(ctx context.Context) bool {
|
||||
if p.p.truncated {
|
||||
return true
|
||||
|
Reference in New Issue
Block a user