summaryrefslogtreecommitdiffstats
path: root/hugofs
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-02-08 08:44:28 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-02-08 20:11:17 +0100
commit0851c175ad1d84dc3464b080379401452b951860 (patch)
treee2bdd26e03d24310c865609346c5a37e38ce16d0 /hugofs
parent676e6875dac391f1ec1f7369ed2d59439f434806 (diff)
Move the duplicate page/resource filter
Move the removal of duplicate content and resource files after we have determined if we're inside a leaf bundle or not. Note that these would eventually have been filtered out as duplicates when inserting them into the document store, but doing it here will preserve a consistent ordering. Fixes #12013
Diffstat (limited to 'hugofs')
-rw-r--r--hugofs/component_fs.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/hugofs/component_fs.go b/hugofs/component_fs.go
index e75e23f84..c3c64b18f 100644
--- a/hugofs/component_fs.go
+++ b/hugofs/component_fs.go
@@ -21,7 +21,6 @@ import (
"sort"
"github.com/gohugoio/hugo/common/herrors"
- "github.com/gohugoio/hugo/common/hstrings"
"github.com/gohugoio/hugo/common/paths"
"github.com/gohugoio/hugo/hugofs/files"
"github.com/spf13/afero"
@@ -150,32 +149,6 @@ func (f *componentFsDir) ReadDir(count int) ([]iofs.DirEntry, error) {
return fimi.Name() < fimj.Name()
})
- if f.fs.opts.Component == files.ComponentFolderContent {
- // Finally filter out any duplicate content or resource files, e.g. page.md and page.html.
- n := 0
- seen := map[hstrings.Tuple]bool{}
- for _, fi := range fis {
- fim := fi.(FileMetaInfo)
- pi := fim.Meta().PathInfo
- keep := fim.IsDir()
-
- if !keep {
- baseLang := hstrings.Tuple{First: pi.Base(), Second: fim.Meta().Lang}
- if !seen[baseLang] {
- keep = true
- seen[baseLang] = true
- }
- }
-
- if keep {
- fis[n] = fi
- n++
- }
- }
-
- fis = fis[:n]
- }
-
return fis, nil
}