summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo_sites_build.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/hugo_sites_build.go')
-rw-r--r--hugolib/hugo_sites_build.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_build.go b/hugolib/hugo_sites_build.go
index c552b9de8..ea73c493f 100644
--- a/hugolib/hugo_sites_build.go
+++ b/hugolib/hugo_sites_build.go
@@ -143,6 +143,21 @@ func (h *HugoSites) Build(config BuildCfg, events ...fsnotify.Event) error {
if err := h.render(infol, conf); err != nil {
h.SendError(fmt.Errorf("render: %w", err))
}
+
+ if h.Configs.Base.LogPathWarnings {
+ // We need to do this before any post processing, as that may write to the same files twice
+ // and create false positives.
+ hugofs.WalkFilesystems(h.Fs.PublishDir, func(fs afero.Fs) bool {
+ if dfs, ok := fs.(hugofs.DuplicatesReporter); ok {
+ dupes := dfs.ReportDuplicates()
+ if dupes != "" {
+ h.Log.Warnln("Duplicate target paths:", dupes)
+ }
+ }
+ return false
+ })
+ }
+
if err := h.postProcess(infol); err != nil {
h.SendError(fmt.Errorf("postProcess: %w", err))
}