Fix some related content issues with content adapters

Fixes #13443
This commit is contained in:
Bjørn Erik Pedersen
2025-02-25 11:28:59 +01:00
parent 227e429267
commit 381c0da85d
8 changed files with 151 additions and 16 deletions

View File

@@ -27,8 +27,6 @@ import (
"github.com/gohugoio/hugo/markup/converter"
xmaps "golang.org/x/exp/maps"
"github.com/gohugoio/hugo/related"
"github.com/gohugoio/hugo/source"
"github.com/gohugoio/hugo/common/constants"
@@ -215,16 +213,6 @@ func (p *pageMeta) PathInfo() *paths.Path {
return p.pathInfo
}
// RelatedKeywords implements the related.Document interface needed for fast page searches.
func (p *pageMeta) RelatedKeywords(cfg related.IndexConfig) ([]related.Keyword, error) {
v, err := p.Param(cfg.Name)
if err != nil {
return nil, err
}
return cfg.ToKeywords(v)
}
func (p *pageMeta) IsSection() bool {
return p.Kind() == kinds.KindSection
}