Skip to content

Commit

Permalink
Fixes ISSUE gohugoio#10364 + code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
abaruchi committed Oct 13, 2022
1 parent a066e98 commit 26eb93a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
3 changes: 0 additions & 3 deletions hugolib/hugo_sites.go
Original file line number Diff line number Diff line change
Expand Up @@ -1094,9 +1094,6 @@ func (m *contentChangeMap) resolveAndRemove(filename string) (string, bundleDirT
// Bundles share resources, so we need to start from the virtual root.
relFilename := m.pathSpec.RelContentDir(filename)
dir, name := filepath.Split(relFilename)
if !strings.HasSuffix(dir, helpers.FilePathSeparator) {
dir += helpers.FilePathSeparator
}

if _, found := m.branchBundles[dir]; found {
delete(m.branchBundles, dir)
Expand Down
1 change: 0 additions & 1 deletion hugolib/pages_capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ func (c *pagesCollector) isCascadingEdit(dir contentDirKey) (bool, string) {
return isCascade, section
}

// Collect.
func (c *pagesCollector) Collect() (collectErr error) {
c.proc.Start(context.Background())
defer func() {
Expand Down
3 changes: 1 addition & 2 deletions hugolib/pages_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"path/filepath"

"github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/source"

"github.com/gohugoio/hugo/hugofs/files"
"golang.org/x/sync/errgroup"
Expand All @@ -28,7 +27,7 @@ import (
"github.com/gohugoio/hugo/hugofs"
)

func newPagesProcessor(h *HugoSites, sp *source.SourceSpec) *pagesProcessor {
func newPagesProcessor(h *HugoSites) *pagesProcessor {
procs := make(map[string]pagesCollectorProcessorProvider)
for _, s := range h.Sites {
procs[s.Lang()] = &sitePagesProcessor{
Expand Down
2 changes: 1 addition & 1 deletion hugolib/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ func (s *Site) eventToIdentity(e fsnotify.Event) (identity.PathIdentity, bool) {
func (s *Site) readAndProcessContent(buildConfig BuildCfg, filenames ...string) error {
sourceSpec := source.NewSourceSpec(s.PathSpec, buildConfig.ContentInclusionFilter, s.BaseFs.Content.Fs)

proc := newPagesProcessor(s.h, sourceSpec)
proc := newPagesProcessor(s.h)

c := newPagesCollector(sourceSpec, s.h.getContentMaps(), s.Log, s.h.ContentChanges, proc, filenames...)

Expand Down

0 comments on commit 26eb93a

Please sign in to comment.