Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-07-24 11:10:51 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-07-24 12:37:59 +0300
commit04d4c08dbcac08ff7feeb88863e91799fed0937b (patch)
tree0c1dd87f381690c73b356602a52cb82b333f12c8 /hugolib/site_sections_test.go
parent016dd4a69a765061bb3da8490d3cac6ec47a91eb (diff)
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
Diffstat (limited to 'hugolib/site_sections_test.go')
-rw-r--r--hugolib/site_sections_test.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/hugolib/site_sections_test.go b/hugolib/site_sections_test.go
index bfec623e5..86ae4080c 100644
--- a/hugolib/site_sections_test.go
+++ b/hugolib/site_sections_test.go
@@ -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)