b.AssertFileContent("public/index.html", "layouts/baseof.html")
b.AssertFileContent("public/amp/index.html", "layouts/baseof.amp.html")
}
+
+func TestAllVsAmp(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+-- content/_index.md --
+---
+title: "Home"
+outputs: ["html", "amp"]
+---
+title: "Home"
+-- layouts/all.html --
+All.
+
+`
+ b := hugolib.Test(t, files)
+ b.AssertFileContent("public/index.html", "All.")
+ b.AssertFileContent("public/amp/index.html", "All.")
+}
if other.Kind != "" && other.Kind != this.Kind {
return w
}
+
if other.Layout != "" && other.Layout != layoutAll && other.Layout != this.Layout {
if isLayoutCustom(this.Layout) {
if this.Kind == "" {
return w
}
}
+
if other.Lang != "" && other.Lang != this.Lang {
return w
}
// We want e.g. home page in amp output format (media type text/html) to
// find a template even if one isn't specified for that output format,
// when one exist for the html output format (same media type).
- if category != CategoryBaseof && (this.Kind == "" || (this.Kind != other.Kind && this.Layout != other.Layout)) {
+ if category != CategoryBaseof && (this.Kind == "" || (this.Kind != other.Kind && (this.Layout != other.Layout && other.Layout != layoutAll))) {
return w
}