diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-02-07 10:30:32 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-02-07 21:37:04 +0100 |
commit | 676e6875dac391f1ec1f7369ed2d59439f434806 (patch) | |
tree | af689eec1f48d511169f8b07f4c65420c7479413 /hugolib/pages_capture.go | |
parent | 068ccde4c75d018b977f4169308b3c994c6f3031 (diff) |
Make HTML behave exactly like other content formats (note)
Fixes #11999
Diffstat (limited to 'hugolib/pages_capture.go')
-rw-r--r-- | hugolib/pages_capture.go | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/hugolib/pages_capture.go b/hugolib/pages_capture.go index a7f8faaf0..9bf88c240 100644 --- a/hugolib/pages_capture.go +++ b/hugolib/pages_capture.go @@ -15,7 +15,6 @@ package hugolib import ( "context" - "errors" "fmt" "os" "path/filepath" @@ -27,8 +26,6 @@ import ( "github.com/bep/logg" "github.com/gohugoio/hugo/common/paths" "github.com/gohugoio/hugo/common/rungroup" - "github.com/gohugoio/hugo/helpers" - "github.com/gohugoio/hugo/parser/pageparser" "github.com/spf13/afero" "github.com/gohugoio/hugo/source" @@ -77,26 +74,6 @@ type pagesCollector struct { g rungroup.Group[hugofs.FileMetaInfo] } -func (c *pagesCollector) copyFile(fim hugofs.FileMetaInfo) error { - meta := fim.Meta() - f, err := meta.Open() - if err != nil { - return fmt.Errorf("copyFile: failed to open: %w", err) - } - - s := c.m.s - - target := filepath.Join(s.PathSpec.GetTargetLanguageBasePath(), meta.PathInfo.Path()) - - defer f.Close() - - fs := s.PublishFsStatic - - s.PathSpec.ProcessingStats.Incr(&s.PathSpec.ProcessingStats.Files) - - return helpers.WriteToDisk(filepath.Clean(target), f, fs) -} - // Collect collects content by walking the file system and storing // it in the content tree. // It may be restricted by filenames set on the collector (partial build). @@ -136,14 +113,7 @@ func (c *pagesCollector) Collect() (collectErr error) { NumWorkers: numWorkers, Handle: func(ctx context.Context, fi hugofs.FileMetaInfo) error { if err := c.m.AddFi(fi); err != nil { - if errors.Is(err, pageparser.ErrPlainHTMLDocumentsNotSupported) { - // Reclassify this as a static file. - if err := c.copyFile(fi); err != nil { - return err - } - } else { - return hugofs.AddFileInfoToError(err, fi, c.fs) - } + return hugofs.AddFileInfoToError(err, fi, c.fs) } numFilesProcessedTotal.Add(1) if numFilesProcessedTotal.Load()%1000 == 0 { |