diff options
Diffstat (limited to 'hugolib/page__meta.go')
-rw-r--r-- | hugolib/page__meta.go | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/hugolib/page__meta.go b/hugolib/page__meta.go index ebf57f3b3..d8203fe75 100644 --- a/hugolib/page__meta.go +++ b/hugolib/page__meta.go @@ -737,6 +737,8 @@ func (p *pageMeta) applyDefaultValues() error { } } + p.pageConfig.IsGoldmark = p.s.ContentSpec.Converters.IsGoldmark(p.pageConfig.Markup) + if p.pageConfig.Title == "" && p.f == nil { switch p.Kind() { case kinds.KindHome: @@ -794,12 +796,26 @@ func (p *pageMeta) newContentConverter(ps *pageState, markup string) (converter. path = p.Path() } + doc := newPageForRenderHook(ps) + + documentLookup := func(id uint64) any { + if id == ps.pid { + // This prevents infinite recursion in some cases. + return doc + } + if v, ok := ps.pageOutput.pco.otherOutputs[id]; ok { + return v.po.p + } + return nil + } + cpp, err := cp.New( converter.DocumentContext{ - Document: newPageForRenderHook(ps), - DocumentID: id, - DocumentName: path, - Filename: filename, + Document: doc, + DocumentLookup: documentLookup, + DocumentID: id, + DocumentName: path, + Filename: filename, }, ) if err != nil { |