From 5fb2e85ca1f2e3933cd34844576bf8fd826bd73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 2 Jun 2023 07:49:42 +0200 Subject: [PATCH] Don't inject livereload script on hugo -w Fixes #11061 --- hugolib/site.go | 2 +- testscripts/commands/hugo__watch.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hugolib/site.go b/hugolib/site.go index d23a903856e..19821e8b2ee 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -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() } diff --git a/testscripts/commands/hugo__watch.txt b/testscripts/commands/hugo__watch.txt index b434bd112ad..aa5201c5666 100644 --- a/testscripts/commands/hugo__watch.txt +++ b/testscripts/commands/hugo__watch.txt @@ -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