summaryrefslogtreecommitdiffstats
path: root/hugolib/site_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-02-10 17:26:28 +0700
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-02-10 18:57:38 +0700
commit2618cfbeaa06bd2a4d26b3e3999e3c9ca9a49854 (patch)
tree40715bf14911177c527225398cb02b6a849f3788 /hugolib/site_test.go
parent25bfa7e12fcd044368e9983481dfd4bfc8558a55 (diff)
hugolib: Fix error for non-renderable HTML content with shortcodes
This commit re-introduces template lookup order that was accidently removed as part of the template nonglobal refactoring. Fixes #3021
Diffstat (limited to 'hugolib/site_test.go')
-rw-r--r--hugolib/site_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/hugolib/site_test.go b/hugolib/site_test.go
index 3f1a8b066..483d6ae71 100644
--- a/hugolib/site_test.go
+++ b/hugolib/site_test.go
@@ -436,6 +436,8 @@ func TestSkipRender(t *testing.T) {
{Name: filepath.FromSlash("sect/doc6.html"), Content: []byte("<!doctype html><html>{{ template \"head_abs\" }}<body>body5</body></html>")},
{Name: filepath.FromSlash("doc7.html"), Content: []byte("<html><body>doc7 content</body></html>")},
{Name: filepath.FromSlash("sect/doc8.html"), Content: []byte("---\nmarkup: md\n---\n# title\nsome *content*")},
+ // Issue #3021
+ {Name: filepath.FromSlash("doc9.html"), Content: []byte("<html><body>doc9: {{< myshortcode >}}</body></html>")},
}
viper.Set("defaultExtension", "html")
@@ -454,6 +456,7 @@ func TestSkipRender(t *testing.T) {
writeSource(t, fs, filepath.Join("layouts", "_default/single.html"), "{{.Content}}")
writeSource(t, fs, filepath.Join("layouts", "head"), "<head><script src=\"script.js\"></script></head>")
writeSource(t, fs, filepath.Join("layouts", "head_abs"), "<head><script src=\"/script.js\"></script></head>")
+ writeSource(t, fs, filepath.Join("layouts", "shortcodes", "myshortcode.html"), "SHORT")
buildSingleSite(t, deps.DepsCfg{Fs: fs}, BuildCfg{})
@@ -469,6 +472,7 @@ func TestSkipRender(t *testing.T) {
{filepath.FromSlash("public/sect/doc6.html"), "<!doctype html><html><head><script src=\"http://auth/bub/script.js\"></script></head><body>body5</body></html>"},
{filepath.FromSlash("public/doc7.html"), "<html><body>doc7 content</body></html>"},
{filepath.FromSlash("public/sect/doc8.html"), "\n\n<h1 id=\"title\">title</h1>\n\n<p>some <em>content</em></p>\n"},
+ {filepath.FromSlash("public/doc9.html"), "<html><body>doc9: SHORT</body></html>"},
}
for _, test := range tests {