diff options
Diffstat (limited to 'hugolib/page.go')
-rw-r--r-- | hugolib/page.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index f8f8f9958..e0e002e59 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -263,6 +263,16 @@ type Page struct { targetPathDescriptorPrototype *targetPathDescriptor } +// Sites is a convenience method to get all the Hugo sites/languages configured. +func (p *Page) Sites() SiteInfos { + infos := make(SiteInfos, len(p.s.owner.Sites)) + for i, site := range p.s.owner.Sites { + infos[i] = &site.Info + } + + return infos +} + // SearchKeywords implements the related.Document interface needed for fast page searches. func (p *Page) SearchKeywords(cfg related.IndexConfig) ([]related.Keyword, error) { |