Skip to content

Commit

Permalink
Don't inject livereload script on hugo -w
Browse files Browse the repository at this point in the history
Fixes #11061
  • Loading branch information
bep committed Jun 2, 2023
1 parent 382c726 commit a191b38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hugolib/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ func (s *Site) renderAndWritePage(statCounter *uint64, name string, targetPath s
pd.AbsURLPath = s.absURLPath(targetPath)
}

if s.watching() && s.conf.Internal.Watch && !s.conf.Internal.DisableLiveReload {
if s.watching() && s.conf.Internal.Running && !s.conf.Internal.DisableLiveReload {
pd.LiveReloadBaseURL = s.Conf.BaseURLLiveReload().URL()
}

Expand Down
1 change: 1 addition & 0 deletions testscripts/commands/hugo__watch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ grep 'P1start' public/p1/index.html
replace content/p1.md 'P1start' 'P1end'
sleep 2
grep 'P1end' public/p1/index.html
! grep 'livereload' public/p1/index.html

stop

Expand Down

0 comments on commit a191b38

Please sign in to comment.