summaryrefslogtreecommitdiffstats
path: root/publisher
diff options
context:
space:
mode:
authorsth <sth.dev@tejp.de>2020-12-02 12:52:26 +0100
committerGitHub <noreply@github.com>2020-12-02 12:52:26 +0100
commit0ad378b09cea90a2a70d7ff06af668abe22475a1 (patch)
treeb8513e229047459cb2337e6dff69aa26640039db /publisher
parentaebfe156fb2f27057e61b2e50c7576e6b06dab58 (diff)
Use --baseURL path for live-reload URL
Fixes #6595
Diffstat (limited to 'publisher')
-rw-r--r--publisher/publisher.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/publisher/publisher.go b/publisher/publisher.go
index 8b8d2fa63..ac2151529 100644
--- a/publisher/publisher.go
+++ b/publisher/publisher.go
@@ -16,6 +16,7 @@ package publisher
import (
"errors"
"io"
+ "net/url"
"sync/atomic"
"github.com/gohugoio/hugo/resources"
@@ -51,8 +52,8 @@ type Descriptor struct {
StatCounter *uint64
// Configuration that trigger pre-processing.
- // LiveReload script will be injected if this is > 0
- LiveReloadPort int
+ // LiveReload script will be injected if this is != nil
+ LiveReloadBaseURL *url.URL
// Enable to inject the Hugo generated tag in the header. Is currently only
// injected on the home page for HTML type of output formats.
@@ -166,8 +167,8 @@ func (p DestinationPublisher) createTransformerChain(f Descriptor) transform.Cha
}
if isHTML {
- if f.LiveReloadPort > 0 {
- transformers = append(transformers, livereloadinject.New(f.LiveReloadPort))
+ if f.LiveReloadBaseURL != nil {
+ transformers = append(transformers, livereloadinject.New(*f.LiveReloadBaseURL))
}
// This is only injected on the home page.