mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
@@ -17,6 +17,7 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
@@ -62,9 +63,8 @@ var (
|
||||
var (
|
||||
pageTypesProvider = resource.NewResourceTypesProvider(media.OctetType, pageResourceType)
|
||||
nopPageOutput = &pageOutput{
|
||||
pagePerOutputProviders: nopPagePerOutput,
|
||||
ContentProvider: page.NopPage,
|
||||
TableOfContentsProvider: page.NopPage,
|
||||
pagePerOutputProviders: nopPagePerOutput,
|
||||
ContentProvider: page.NopPage,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -159,6 +159,11 @@ func (p *pageState) Fragments(ctx context.Context) *tableofcontents.Fragments {
|
||||
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
|
||||
}
|
||||
@@ -951,7 +956,6 @@ func (p *pageState) shiftToOutputFormat(isRenderingSite bool, idx int) error {
|
||||
})
|
||||
p.pageOutput.contentRenderer = lcp
|
||||
p.pageOutput.ContentProvider = lcp
|
||||
p.pageOutput.TableOfContentsProvider = lcp
|
||||
p.pageOutput.PageRenderProvider = lcp
|
||||
}
|
||||
}
|
||||
|
@@ -54,13 +54,12 @@ func newPageOutput(
|
||||
}
|
||||
|
||||
po := &pageOutput{
|
||||
f: f,
|
||||
pagePerOutputProviders: providers,
|
||||
ContentProvider: page.NopPage,
|
||||
TableOfContentsProvider: page.NopPage,
|
||||
PageRenderProvider: page.NopPage,
|
||||
render: render,
|
||||
paginator: pag,
|
||||
f: f,
|
||||
pagePerOutputProviders: providers,
|
||||
ContentProvider: page.NopPage,
|
||||
PageRenderProvider: page.NopPage,
|
||||
render: render,
|
||||
paginator: pag,
|
||||
}
|
||||
|
||||
return po
|
||||
@@ -84,7 +83,6 @@ type pageOutput struct {
|
||||
contentRenderer page.ContentRenderer
|
||||
pagePerOutputProviders
|
||||
page.ContentProvider
|
||||
page.TableOfContentsProvider
|
||||
page.PageRenderProvider
|
||||
|
||||
// May be nil.
|
||||
@@ -97,7 +95,6 @@ func (p *pageOutput) initContentProvider(cp *pageContentOutput) {
|
||||
}
|
||||
p.contentRenderer = cp
|
||||
p.ContentProvider = cp
|
||||
p.TableOfContentsProvider = cp
|
||||
p.PageRenderProvider = cp
|
||||
p.cp = cp
|
||||
|
||||
|
Reference in New Issue
Block a user