diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-04-15 15:17:46 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-04-15 18:31:56 +0200 |
commit | 56550d1e449f45ebee398ac8a9e3b9818b3ee60e (patch) | |
tree | 4f1e262784a3b875b7a5ed4644afd85fcc0a7282 /hugolib | |
parent | 7881b0965f8b83d03379e9ed102cd0c3bce297e2 (diff) |
hugolib: Fix shortcode namespace issue
Fixes #5863
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/shortcode_test.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index dd01eb5c5..ea56bf792 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -1126,3 +1126,32 @@ CONTENT:{{ .Content }} } } + +// https://github.com/gohugoio/hugo/issues/5863 +func TestShortcodeNamespaced(t *testing.T) { + t.Parallel() + assert := require.New(t) + + builder := newTestSitesBuilder(t).WithSimpleConfigFile() + + builder.WithContent("page.md", `--- +title: "Hugo Rocks!" +--- + +# doc + + hello: {{< hello >}} + test/hello: {{< test/hello >}} + +`).WithTemplatesAdded( + "layouts/shortcodes/hello.html", `hello`, + "layouts/shortcodes/test/hello.html", `test/hello`).CreateSites().Build(BuildCfg{}) + + s := builder.H.Sites[0] + assert.Equal(1, len(s.RegularPages())) + + builder.AssertFileContent("public/page/index.html", + "hello: hello", + "test/hello: test/hello", + ) +} |