mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
Add Page.Contents with scope support
Note that this also adds a new `.ContentWithoutSummary` method, and to do that we had to unify the different summary types: Both `auto` and `manual` now returns HTML. Before this commit, `auto` would return plain text. This could be considered to be a slightly breaking change, but for the better: Now you can treat the `.Summary` the same without thinking about where it comes from, and if you want plain text, pipe it into `{{ .Summary | plainify }}`. Fixes #8680 Fixes #12761 Fixes #12778 Fixes #716
This commit is contained in:
@@ -65,6 +65,7 @@ func newPageOutput(
|
||||
p: ps,
|
||||
f: f,
|
||||
pagePerOutputProviders: providers,
|
||||
MarkupProvider: page.NopPage,
|
||||
ContentProvider: page.NopPage,
|
||||
PageRenderProvider: page.NopPage,
|
||||
TableOfContentsProvider: page.NopPage,
|
||||
@@ -95,6 +96,7 @@ type pageOutput struct {
|
||||
// output format.
|
||||
contentRenderer page.ContentRenderer
|
||||
pagePerOutputProviders
|
||||
page.MarkupProvider
|
||||
page.ContentProvider
|
||||
page.PageRenderProvider
|
||||
page.TableOfContentsProvider
|
||||
@@ -119,7 +121,7 @@ func (po *pageOutput) isRendered() bool {
|
||||
if po.renderState > 0 {
|
||||
return true
|
||||
}
|
||||
if po.pco != nil && po.pco.contentRendered {
|
||||
if po.pco != nil && po.pco.contentRendered.Load() {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -139,6 +141,7 @@ func (p *pageOutput) setContentProvider(cp *pageContentOutput) {
|
||||
}
|
||||
p.contentRenderer = cp
|
||||
p.ContentProvider = cp
|
||||
p.MarkupProvider = cp
|
||||
p.PageRenderProvider = cp
|
||||
p.TableOfContentsProvider = cp
|
||||
p.RenderShortcodesProvider = cp
|
||||
|
Reference in New Issue
Block a user