Fix false path warnings with resources.PostProcess

Fixes #7735
This commit is contained in:
Bjørn Erik Pedersen
2023-06-27 09:16:42 +02:00
parent 12e4c4d5dc
commit fa0e16f4c7
4 changed files with 61 additions and 13 deletions

View File

@@ -45,7 +45,6 @@ import (
"github.com/gohugoio/hugo/resources/page"
"github.com/gohugoio/hugo/tpl"
"github.com/gohugoio/hugo/watcher"
"github.com/spf13/afero"
"github.com/spf13/fsync"
"golang.org/x/sync/errgroup"
"golang.org/x/sync/semaphore"
@@ -419,18 +418,6 @@ func (c *hugoBuilder) build() error {
return err
}
if c.r.printPathWarnings {
hugofs.WalkFilesystems(h.Fs.PublishDir, func(fs afero.Fs) bool {
if dfs, ok := fs.(hugofs.DuplicatesReporter); ok {
dupes := dfs.ReportDuplicates()
if dupes != "" {
c.r.logger.Warnln("Duplicate target paths:", dupes)
}
}
return false
})
}
if c.r.printUnusedTemplates {
unusedTemplates := h.Tmpl().(tpl.UnusedTemplatesProvider).UnusedTemplates()
for _, unusedTemplate := range unusedTemplates {