aboutsummaryrefslogtreecommitdiffhomepage
path: root/commands/hugobuilder.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-11-25 10:39:17 +0100
committerBjørn Erik Pedersen <[email protected]>2024-11-25 10:39:17 +0100
commitdea158c88514afbd24f67558039ec4d20cd5aed1 (patch)
tree5b9e3c14f890d67bd16ac7e5d43ad36d31e64c1d /commands/hugobuilder.go
parent467444ef649b35676ed5b4198eb8165b347d9119 (diff)
downloadhugo-dea158c88514afbd24f67558039ec4d20cd5aed1.tar.gz
hugo-dea158c88514afbd24f67558039ec4d20cd5aed1.zip
commands: Fix flaw in the livereload logic
I guess most commonly an issue with TailwindCSS editing in templates: * Build changes both CSS and index.html => reload OK. * Build changes both CSS and index.html and some other files => only CSS reloaded. The above would fix itself with one more edit, but that's annoying.
Diffstat (limited to 'commands/hugobuilder.go')
-rw-r--r--commands/hugobuilder.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/hugobuilder.go b/commands/hugobuilder.go
index 95129018f..51493938d 100644
--- a/commands/hugobuilder.go
+++ b/commands/hugobuilder.go
@@ -966,7 +966,7 @@ func (c *hugoBuilder) handleEvents(watcher *watcher.Batcher,
pathToRefresh := h.PathSpec.RelURL(paths.ToSlashTrimLeading(otherChanges[0]), false)
lrl.Logf("refreshing %q", pathToRefresh)
livereload.RefreshPath(pathToRefresh)
- } else if len(cssChanges) == 0 {
+ } else if len(cssChanges) == 0 || len(otherChanges) > 1 {
lrl.Logf("force refresh")
livereload.ForceRefresh()
}