diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-05-29 22:33:03 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-05-29 22:33:03 +0200 |
commit | 4c560020bc0c50f8004873be8adf83698b7c095a (patch) | |
tree | 34f69d29774d2e6409436c4ecba98231947601f7 /hugolib/resource_chain_test.go | |
parent | d44d3ea89865baa33170244cac72a7ce26419b15 (diff) |
resources: Return nil when not found in resources.Get
Fixes #5999
Diffstat (limited to 'hugolib/resource_chain_test.go')
-rw-r--r-- | hugolib/resource_chain_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hugolib/resource_chain_test.go b/hugolib/resource_chain_test.go index e22121b77..5a8ac22d7 100644 --- a/hugolib/resource_chain_test.go +++ b/hugolib/resource_chain_test.go @@ -356,6 +356,11 @@ CSV2: {{ $csv2 }} `CSV2: [[a b c]]`, ) }}, + {"resources.Get", func() bool { return true }, func(b *sitesBuilder) { + b.WithTemplates("home.html", `NOT FOUND: {{ if (resources.Get "this-does-not-exist") }}FAILED{{ else }}OK{{ end }}`) + }, func(b *sitesBuilder) { + b.AssertFileContent("public/index.html", "NOT FOUND: OK") + }}, {"template", func() bool { return true }, func(b *sitesBuilder) {}, func(b *sitesBuilder) { }}, |