mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
tpl: Fix indeterminate template lookup with templates with and without lang
Close #13636
This commit is contained in:
@@ -1842,7 +1842,9 @@ func (best *bestMatch) isBetter(w weight, ti *TemplInfo) bool {
|
||||
// Anything is better than nothing.
|
||||
return true
|
||||
}
|
||||
|
||||
if w.w1 <= 0 {
|
||||
|
||||
if best.w.w1 <= 0 {
|
||||
return ti.PathInfo.Path() < best.templ.PathInfo.Path()
|
||||
}
|
||||
@@ -1885,11 +1887,7 @@ func (best *bestMatch) isBetter(w weight, ti *TemplInfo) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
if ti.D.LayoutFromTemplate != "" && best.desc.LayoutFromTemplate != "" {
|
||||
return ti.D.LayoutFromTemplate != layoutAll
|
||||
}
|
||||
|
||||
return w.distance < best.w.distance || ti.PathInfo.Path() < best.templ.PathInfo.Path()
|
||||
return ti.PathInfo.Path() < best.templ.PathInfo.Path()
|
||||
}
|
||||
|
||||
return true
|
||||
|
Reference in New Issue
Block a user