summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo_sites.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-09-06 11:03:23 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-09-06 11:03:23 +0200
commit901077c0364eaf3fe4f997c3026aa18cfc7781ed (patch)
treedd9640beccac8f20ef1711c8a952f391ab0425fb /hugolib/hugo_sites.go
parent24ad4295718341dcae12b72bf52fef312d1036ed (diff)
hugolib: Fix broken bundle live reload logic
Fixes #6315 Updates #6308
Diffstat (limited to 'hugolib/hugo_sites.go')
-rw-r--r--hugolib/hugo_sites.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go
index 987144f1d..c0d75c09f 100644
--- a/hugolib/hugo_sites.go
+++ b/hugolib/hugo_sites.go
@@ -837,15 +837,16 @@ type contentChangeMap struct {
symContent map[string]map[string]bool
}
-func (m *contentChangeMap) add(filename string, tp bundleDirType) {
+func (m *contentChangeMap) add(dirname string, tp bundleDirType) {
m.mu.Lock()
- dir := filepath.Dir(filename) + helpers.FilePathSeparator
- dir = strings.TrimPrefix(dir, ".")
+ if !strings.HasSuffix(dirname, helpers.FilePathSeparator) {
+ dirname += helpers.FilePathSeparator
+ }
switch tp {
case bundleBranch:
- m.branchBundles[dir] = true
+ m.branchBundles[dirname] = true
case bundleLeaf:
- m.leafBundles.Insert(dir, true)
+ m.leafBundles.Insert(dirname, true)
default:
panic("invalid bundle type")
}