diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-11-17 12:27:50 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-11-17 13:08:18 +0100 |
commit | 0a81a6b4bae3de53aa9c179b855c671a2d30eec7 (patch) | |
tree | aaeea4e453bbf5b5f61cf0b10fa5d21415c90f00 /output/layout_base_test.go | |
parent | 60dfb9a6e076200ab3ca3fd30e34bb3c14e0a893 (diff) |
output: Fall back to unstranslated base template
Fixes #3893
Diffstat (limited to 'output/layout_base_test.go')
-rw-r--r-- | output/layout_base_test.go | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/output/layout_base_test.go b/output/layout_base_test.go index 2435fed03..d7c7fbb90 100644 --- a/output/layout_base_test.go +++ b/output/layout_base_test.go @@ -50,6 +50,19 @@ func TestLayoutBase(t *testing.T) { OverlayFilename: "/sites/mysite/layouts/_default/single.html", MasterFilename: "/sites/mysite/layouts/_default/single-baseof.html", }}, + // Issue #3893 + {"Base Lang, Default Base", TemplateLookupDescriptor{TemplateDir: workingDir, WorkingDir: workingDir, LayoutDir: "layouts", RelPath: "_default/list.en.html"}, true, "_default/baseof.html", + TemplateNames{ + Name: "_default/list.en.html", + OverlayFilename: "/sites/mysite/layouts/_default/list.en.html", + MasterFilename: "/sites/mysite/layouts/_default/baseof.html", + }}, + {"Base Lang, Lang Base", TemplateLookupDescriptor{TemplateDir: workingDir, WorkingDir: workingDir, LayoutDir: "layouts", RelPath: "_default/list.en.html"}, true, "_default/baseof.html|_default/baseof.en.html", + TemplateNames{ + Name: "_default/list.en.html", + OverlayFilename: "/sites/mysite/layouts/_default/list.en.html", + MasterFilename: "/sites/mysite/layouts/_default/baseof.en.html", + }}, // Issue #3856 {"Base Taxonomy Term", TemplateLookupDescriptor{TemplateDir: workingDir, WorkingDir: workingDir, LayoutDir: layoutBase1, RelPath: "taxonomy/tag.terms.html"}, true, "_default/baseof.html", TemplateNames{ @@ -116,12 +129,11 @@ func TestLayoutBase(t *testing.T) { OverlayFilename: "/sites/mysite/layouts/_default/single.amp.html", MasterFilename: "/sites/mysite/layouts/_default/single-baseof.amp.html", }}, - {"AMP with no match in base", TemplateLookupDescriptor{TemplateDir: workingDir, WorkingDir: workingDir, LayoutDir: layoutBase1, RelPath: layoutPathAmp}, true, "single-baseof.html", + {"AMP with no AMP base", TemplateLookupDescriptor{TemplateDir: workingDir, WorkingDir: workingDir, LayoutDir: layoutBase1, RelPath: layoutPathAmp}, true, "single-baseof.html", TemplateNames{ Name: "_default/single.amp.html", OverlayFilename: "/sites/mysite/layouts/_default/single.amp.html", - // There is a single-baseof.html, but that makes no sense. - MasterFilename: "", + MasterFilename: "/sites/mysite/layouts/_default/single-baseof.html", }}, {"JSON with base", TemplateLookupDescriptor{TemplateDir: workingDir, WorkingDir: workingDir, LayoutDir: layoutBase1, RelPath: layoutPathJSON}, true, "single-baseof.json", |