tpl: Fix layout fall back logic when layout is set in front matter but not found

Fixes #13630
This commit is contained in:
Bjørn Erik Pedersen
2025-04-21 11:28:33 +02:00
parent 1408c156d8
commit 5e62cc6fce
2 changed files with 26 additions and 5 deletions

View File

@@ -94,14 +94,10 @@ func (this TemplateDescriptor) doCompare(category Category, isEmbedded bool, oth
}
if other.LayoutFromTemplate != "" && other.LayoutFromTemplate != layoutAll {
if this.LayoutFromUser == "" {
if this.LayoutFromUser == "" || this.LayoutFromUser != other.LayoutFromTemplate {
if other.LayoutFromTemplate != this.LayoutFromTemplate {
return w
}
} else if isLayoutStandard(this.LayoutFromUser) {
if other.LayoutFromTemplate != this.LayoutFromUser {
return w
}
}
}