summaryrefslogtreecommitdiffstats
path: root/output/layout.go
diff options
context:
space:
mode:
Diffstat (limited to 'output/layout.go')
-rw-r--r--output/layout.go30
1 files changed, 2 insertions, 28 deletions
diff --git a/output/layout.go b/output/layout.go
index 206293842..f83490d81 100644
--- a/output/layout.go
+++ b/output/layout.go
@@ -41,8 +41,6 @@ type LayoutDescriptor struct {
// LayoutHandler calculates the layout template to use to render a given output type.
type LayoutHandler struct {
- hasTheme bool
-
mu sync.RWMutex
cache map[layoutCacheKey][]string
}
@@ -53,8 +51,8 @@ type layoutCacheKey struct {
}
// NewLayoutHandler creates a new LayoutHandler.
-func NewLayoutHandler(hasTheme bool) *LayoutHandler {
- return &LayoutHandler{hasTheme: hasTheme, cache: make(map[layoutCacheKey][]string)}
+func NewLayoutHandler() *LayoutHandler {
+ return &LayoutHandler{cache: make(map[layoutCacheKey][]string)}
}
// For returns a layout for the given LayoutDescriptor and options.
@@ -72,30 +70,6 @@ func (l *LayoutHandler) For(d LayoutDescriptor, f Format) ([]string, error) {
layouts := resolvePageTemplate(d, f)
- if l.hasTheme {
- // From Hugo 0.33 we interleave the project/theme templates. This was kind of a fundamental change, but the
- // previous behaviour was surprising.
- // As an example, an `index.html` in theme for the home page will now win over a `_default/list.html` in the project.
- layoutsWithThemeLayouts := []string{}
-
- // First place all non internal templates
- for _, t := range layouts {
- if !strings.HasPrefix(t, "_internal/") {
- layoutsWithThemeLayouts = append(layoutsWithThemeLayouts, t)
- layoutsWithThemeLayouts = append(layoutsWithThemeLayouts, "theme/"+t)
- }
- }
-
- // Lastly place internal templates
- for _, t := range layouts {
- if strings.HasPrefix(t, "_internal/") {
- layoutsWithThemeLayouts = append(layoutsWithThemeLayouts, t)
- }
- }
-
- layouts = layoutsWithThemeLayouts
- }
-
layouts = prependTextPrefixIfNeeded(f, layouts...)
layouts = helpers.UniqueStrings(layouts)