diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-21 21:45:03 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-22 20:41:40 +0300 |
commit | cd07e6d57b158a76f812e8c4c9567dbc84f57939 (patch) | |
tree | 2b16255aabae10b38d49f672843072f895fbf2f4 /hugolib | |
parent | 628efd6e293d27984a3f5ba33522f8edd19d69d6 (diff) |
Fix GetPage Params case issue
Fixes #5946
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/case_insensitive_test.go | 5 | ||||
-rw-r--r-- | hugolib/testhelpers_test.go | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/hugolib/case_insensitive_test.go b/hugolib/case_insensitive_test.go index bffffb6be..5c7dbe073 100644 --- a/hugolib/case_insensitive_test.go +++ b/hugolib/case_insensitive_test.go @@ -179,6 +179,10 @@ Site Title: {{ .Site.Title }} Site Lang Mood: {{ .Site.Language.Params.MOoD }} Page Colors: {{ .Params.COLOR }}|{{ .Params.Colors.Blue }} Site Colors: {{ .Site.Params.COLOR }}|{{ .Site.Params.COLORS.YELLOW }} +{{ $page2 := .Site.GetPage "/sect2/page2" }} +{{ if $page2 }} +Page2: {{ $page2.Params.ColoR }} +{{ end }} {{ .Content }} {{ partial "partial.html" . }} `) @@ -207,6 +211,7 @@ Site Colors: {{ .Site.Params.COLOR }}|{{ .Site.Params.COLORS.YELLOW }} "Page Title: Side 1", "Site Title: Nynorsk title", "«Hi»", // angled quotes + "Page2: black ", ) th.assertFileContent(filepath.Join("public", "en", "sect1", "page1", "index.html"), diff --git a/hugolib/testhelpers_test.go b/hugolib/testhelpers_test.go index 00f802359..08949a1fd 100644 --- a/hugolib/testhelpers_test.go +++ b/hugolib/testhelpers_test.go @@ -743,7 +743,7 @@ func (th testHelper) assertFileContent(filename string, matches ...string) { content := readDestination(th, th.Fs, filename) for _, match := range matches { match = th.replaceDefaultContentLanguageValue(match) - th.Assert(strings.Contains(content, match), qt.Equals, true) + th.Assert(strings.Contains(content, match), qt.Equals, true, qt.Commentf(content)) } } |