Skip to content

Commit

Permalink
Fix some livereload content regressions
Browse files Browse the repository at this point in the history
Introduced in Hugo 0.38.

Fixes gohugoio#4566
  • Loading branch information
bep committed Apr 5, 2018
1 parent 26f34fd commit 9f3c649
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions hugolib/hugo_sites.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ func (cfg *BuildCfg) shouldRender(p *Page) bool {
return true
}

if cfg.whatChanged != nil && p.File != nil && cfg.whatChanged.files[p.File.Filename()] {
return true
if cfg.whatChanged != nil && p.File != nil {
return cfg.whatChanged.files[p.File.Filename()]
}

return false
Expand Down Expand Up @@ -708,10 +708,15 @@ func (m *contentChangeMap) resolveAndRemove(filename string) (string, string, bu
dir += helpers.FilePathSeparator
}

fileTp, _ := classifyBundledFile(name)
fileTp, isContent := classifyBundledFile(name)

// This may be a member of a bundle. Start with branch bundles, the most specific.
if fileTp != bundleLeaf {
if fileTp == bundleNot && isContent {
// Branch bundles does not contain content pages as resources.
return dir, filename, bundleNot
}

for i, b := range m.branches {
if b == dir {
m.branches = append(m.branches[:i], m.branches[i+1:]...)
Expand Down
2 changes: 1 addition & 1 deletion hugolib/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ func (ps Pages) findPagePosByFilnamePrefix(prefix string) int {
// will return -1 if not found
func (ps Pages) findPagePos(page *Page) int {
for i, x := range ps {
if x.Source.Path() == page.Source.Path() {
if x.Source.Filename() == page.Source.Filename() {
return i
}
}
Expand Down

0 comments on commit 9f3c649

Please sign in to comment.