mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
output: Remove duplicate layout lookup layouts
This can happen for sections if Type and Section are equal. Of no real practical difference, but it makes the docs less confusing. Fixes #4319
This commit is contained in:
parent
3446fe9b89
commit
b2fcbb1f97
1 changed files with 3 additions and 0 deletions
|
@ -17,6 +17,8 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
)
|
||||
|
||||
// These may be used as content sections with potential conflicts. Avoid that.
|
||||
|
@ -95,6 +97,7 @@ func (l *LayoutHandler) For(d LayoutDescriptor, f Format) ([]string, error) {
|
|||
}
|
||||
|
||||
layouts = prependTextPrefixIfNeeded(f, layouts...)
|
||||
layouts = helpers.UniqueStrings(layouts)
|
||||
|
||||
l.mu.Lock()
|
||||
l.cache[key] = layouts
|
||||
|
|
Loading…
Reference in a new issue