mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
@@ -134,15 +134,16 @@ func resolvePageTemplate(d LayoutDescriptor, f Format) []string {
|
||||
|
||||
b := &layoutBuilder{d: d, f: f}
|
||||
|
||||
if !d.RenderingHook && d.Layout != "" {
|
||||
b.addLayoutVariations(d.Layout)
|
||||
}
|
||||
if d.Type != "" {
|
||||
b.addTypeVariations(d.Type)
|
||||
}
|
||||
|
||||
if d.RenderingHook {
|
||||
b.addLayoutVariations(d.Kind)
|
||||
} else {
|
||||
if d.Layout != "" {
|
||||
b.addLayoutVariations(d.Layout)
|
||||
}
|
||||
if d.Type != "" {
|
||||
b.addTypeVariations(d.Type)
|
||||
}
|
||||
b.addSectionType()
|
||||
}
|
||||
|
||||
switch d.Kind {
|
||||
|
@@ -128,9 +128,8 @@ func TestLayout(t *testing.T) {
|
||||
[]string{"404.html.html", "404.html"}, 2},
|
||||
{"404, HTML baseof", LayoutDescriptor{Kind: "404", Baseof: true}, "", htmlFormat,
|
||||
[]string{"404-baseof.html.html", "baseof.html.html", "404-baseof.html", "baseof.html", "_default/404-baseof.html.html", "_default/baseof.html.html", "_default/404-baseof.html", "_default/baseof.html"}, 8},
|
||||
// We may add type support ... later.
|
||||
{"Content hook", LayoutDescriptor{Kind: "render-link", RenderingHook: true, Layout: "mylayout", Section: "blog"}, "", ampType,
|
||||
[]string{"_default/_markup/render-link.amp.html", "_default/_markup/render-link.html"}, 2},
|
||||
[]string{"blog/_markup/render-link.amp.html", "blog/_markup/render-link.html", "_default/_markup/render-link.amp.html", "_default/_markup/render-link.html"}, 4},
|
||||
} {
|
||||
c.Run(this.name, func(c *qt.C) {
|
||||
l := NewLayoutHandler()
|
||||
|
Reference in New Issue
Block a user