mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Fix .Fragments when called cross sites on uninitialized output format
Fixes #10794
This commit is contained in:
@@ -17,7 +17,6 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
@@ -151,19 +150,6 @@ func (p *pageState) GetIdentity() identity.Identity {
|
||||
return identity.NewPathIdentity(files.ComponentFolderContent, filepath.FromSlash(p.Pathc()))
|
||||
}
|
||||
|
||||
func (p *pageState) Fragments(ctx context.Context) *tableofcontents.Fragments {
|
||||
p.s.initInit(ctx, p.cp.initToC, p)
|
||||
if p.pageOutput.cp.tableOfContents == nil {
|
||||
return tableofcontents.Empty
|
||||
}
|
||||
return p.pageOutput.cp.tableOfContents
|
||||
}
|
||||
|
||||
func (p *pageState) TableOfContents(ctx context.Context) template.HTML {
|
||||
p.s.initInit(ctx, p.cp.initToC, p)
|
||||
return p.pageOutput.cp.tableOfContentsHTML
|
||||
}
|
||||
|
||||
func (p *pageState) HeadingsFiltered(context.Context) tableofcontents.Headings {
|
||||
return nil
|
||||
}
|
||||
@@ -957,6 +943,7 @@ func (p *pageState) shiftToOutputFormat(isRenderingSite bool, idx int) error {
|
||||
p.pageOutput.contentRenderer = lcp
|
||||
p.pageOutput.ContentProvider = lcp
|
||||
p.pageOutput.PageRenderProvider = lcp
|
||||
p.pageOutput.TableOfContentsProvider = lcp
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user