From 74daca6b3050d96cd3a08b13f45de24edb450163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 14 Sep 2022 11:58:45 +0200 Subject: Support PostProcess for all file types Not just HTML. Fixes #10269 --- hugolib/hugo_sites_build.go | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'hugolib/hugo_sites_build.go') diff --git a/hugolib/hugo_sites_build.go b/hugolib/hugo_sites_build.go index 1a191257c..3bebc5284 100644 --- a/hugolib/hugo_sites_build.go +++ b/hugolib/hugo_sites_build.go @@ -18,7 +18,6 @@ import ( "context" "encoding/json" "fmt" - "os" "path/filepath" "runtime/trace" "strings" @@ -439,23 +438,15 @@ func (h *HugoSites) postProcess() error { return nil } - _ = afero.Walk(h.BaseFs.PublishFs, "", func(path string, info os.FileInfo, err error) error { - if info == nil || info.IsDir() { - return nil - } - - if !strings.HasSuffix(path, "html") { - return nil - } - + for _, filename := range h.Deps.FilenameHasPostProcessPrefix { + filename := filename g.Run(func() error { - return handleFile(path) + return handleFile(filename) }) - - return nil - }) + } // Prepare for a new build. + h.Deps.FilenameHasPostProcessPrefix = nil for _, s := range h.Sites { s.ResourceSpec.PostProcessResources = make(map[string]postpub.PostPublishedResource) } -- cgit v1.2.3