Skip to content

Commit

Permalink
output: Remove duplicate layout lookup layouts
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bep committed Jan 25, 2018
1 parent 3446fe9 commit b2fcbb1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions output/layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b2fcbb1

Please sign in to comment.