summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2018-04-05 10:57:13 +0200
committerBjørn Erik Pedersen <[email protected]>2018-04-05 14:28:45 +0200
commita4deaeff0cfd70abfbefa6d40c0b86839a216f6d (patch)
treedbbe39b90f2e569928ff197bb278e8aa5ca21c68
parent4d115c56fac9060230fbac6181a05f7cc6d10b42 (diff)
downloadhugo-a4deaeff0cfd70abfbefa6d40c0b86839a216f6d.tar.gz
hugo-a4deaeff0cfd70abfbefa6d40c0b86839a216f6d.zip
Fix some livereload content regressions
Introduced in Hugo 0.38. Fixes #4566
-rw-r--r--hugolib/hugo_sites.go11
-rw-r--r--hugolib/page.go2
-rw-r--r--hugolib/site.go3
3 files changed, 11 insertions, 5 deletions
diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go
index f0eb21dc1..cac59e4ca 100644
--- a/hugolib/hugo_sites.go
+++ b/hugolib/hugo_sites.go
@@ -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
@@ -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:]...)
diff --git a/hugolib/page.go b/hugolib/page.go
index 2b3ca37ba..195e68084 100644
--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -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
}
}
diff --git a/hugolib/site.go b/hugolib/site.go
index 4027ce075..b0d70bff2 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -1225,7 +1225,8 @@ func (s *Site) absContentDir() string {
}
func (s *Site) isContentDirEvent(e fsnotify.Event) bool {
- return s.getContentDir(e.Name) != ""
+ relDir, _ := s.PathSpec.RelContentDir(e.Name)
+ return relDir != e.Name
}
func (s *Site) getContentDir(path string) string {