summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo_sites_build.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-09-14 11:58:45 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-09-14 19:09:20 +0200
commit74daca6b3050d96cd3a08b13f45de24edb450163 (patch)
treed740f7e7174c4685dae8cb262a790300b005be76 /hugolib/hugo_sites_build.go
parent1fd4c562afd467f246c632e9f3fed0a1f350d8dc (diff)
Support PostProcess for all file types
Not just HTML. Fixes #10269
Diffstat (limited to 'hugolib/hugo_sites_build.go')
-rw-r--r--hugolib/hugo_sites_build.go19
1 files changed, 5 insertions, 14 deletions
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)
}