summaryrefslogtreecommitdiffstats
path: root/output/layout.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-01-27 12:30:31 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-01-27 12:30:31 +0100
commit74b6c4e5ff5ee16f0e6b352a26c1e58b90a25dc6 (patch)
tree22c126aa60bd1cd01eed086df160c8bdd674d2e1 /output/layout.go
parent8df5d76e708238563185bac84809b34a4d395734 (diff)
And now finally fix the 404 templates
Fixes #6795
Diffstat (limited to 'output/layout.go')
-rw-r--r--output/layout.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/output/layout.go b/output/layout.go
index 0421e6f3d..e59404684 100644
--- a/output/layout.go
+++ b/output/layout.go
@@ -43,7 +43,7 @@ type LayoutDescriptor struct {
}
func (d LayoutDescriptor) isList() bool {
- return !d.RenderingHook && d.Kind != "page"
+ return !d.RenderingHook && d.Kind != "page" && d.Kind != "404"
}
// LayoutHandler calculates the layout template to use to render a given output type.
@@ -173,7 +173,9 @@ func resolvePageTemplate(d LayoutDescriptor, f Format) []string {
b.addTypeVariations("taxonomy")
b.addSectionType()
b.addLayoutVariations("terms")
-
+ case "404":
+ b.addLayoutVariations("404")
+ b.addTypeVariations("")
}
isRSS := f.Name == RSSFormat.Name
@@ -182,8 +184,10 @@ func resolvePageTemplate(d LayoutDescriptor, f Format) []string {
b.addLayoutVariations("")
}
- // All have _default in their lookup path
- b.addTypeVariations("_default")
+ if d.Baseof || d.Kind != "404" {
+ // Most have _default in their lookup path
+ b.addTypeVariations("_default")
+ }
if d.isList() {
// Add the common list type