]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
Don't inject livereload script on hugo -w
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 2 Jun 2023 05:49:42 +0000 (07:49 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 2 Jun 2023 07:04:00 +0000 (09:04 +0200)
Fixes #11061

hugolib/site.go
testscripts/commands/hugo__watch.txt

index d23a903856e0e571126439f0794fa48f6e322067..19821e8b2eee3e5b681bbf7780d26cbc650cc70d 100644 (file)
@@ -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()
                }
 
index b434bd112adb3bec6db3f0f9ccbf603a6faeb99d..aa5201c5666bc98e8c6f04d1cf6ec6afa59aa894 100644 (file)
@@ -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