From b2fcbb1f9774aa1e929b8575c0e1ac366ab2fb73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 25 Jan 2018 09:37:05 +0100 Subject: 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 --- output/layout.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'output') diff --git a/output/layout.go b/output/layout.go index 5ffc19130..206293842 100644 --- a/output/layout.go +++ b/output/layout.go @@ -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 -- cgit v1.2.3