hugolib: Fix .Site.GetPage regression

In Hugo 0.44 we simplified the `.Site.GetPage` API and added code to handle the old-style syntax in most cases.

This logic did not handle the lookup of the home page via `.Site.GetPage "section" ""` and similar. This commit fixes that.

Fixes #4989
This commit is contained in:
Bjørn Erik Pedersen 2018-07-24 10:10:51 +02:00
parent 016dd4a69a
commit 04d4c08dbc
2 changed files with 10 additions and 1 deletions

View file

@ -109,6 +109,8 @@ Content
{{ range .Paginator.Pages }}
PAG|{{ .Title }}|{{ $sect.InSection . }}
{{ end }}
{{/* https://github.com/gohugoio/hugo/issues/4989 */}}
{{ $sections := (.Site.GetPage "section" .Section).Sections.ByWeight }}
</html>`)
cfg.Set("paginate", 2)