diff options
author | sth <[email protected]> | 2020-12-02 12:52:26 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-02 12:52:26 +0100 |
commit | 0ad378b09cea90a2a70d7ff06af668abe22475a1 (patch) | |
tree | b8513e229047459cb2337e6dff69aa26640039db /publisher | |
parent | aebfe156fb2f27057e61b2e50c7576e6b06dab58 (diff) | |
download | hugo-0ad378b09cea90a2a70d7ff06af668abe22475a1.tar.gz hugo-0ad378b09cea90a2a70d7ff06af668abe22475a1.zip |
Use --baseURL path for live-reload URL
Fixes #6595
Diffstat (limited to 'publisher')
-rw-r--r-- | publisher/publisher.go | 9 |
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. |