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 /hugolib/site.go | |
parent | aebfe156fb2f27057e61b2e50c7576e6b06dab58 (diff) | |
download | hugo-0ad378b09cea90a2a70d7ff06af668abe22475a1.tar.gz hugo-0ad378b09cea90a2a70d7ff06af668abe22475a1.zip |
Use --baseURL path for live-reload URL
Fixes #6595
Diffstat (limited to 'hugolib/site.go')
-rw-r--r-- | hugolib/site.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hugolib/site.go b/hugolib/site.go index c89995ab0..05dd2307a 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -1716,7 +1716,10 @@ func (s *Site) renderAndWritePage(statCounter *uint64, name string, targetPath s } if s.running() && s.Cfg.GetBool("watch") && !s.Cfg.GetBool("disableLiveReload") { - pd.LiveReloadPort = s.Cfg.GetInt("liveReloadPort") + pd.LiveReloadBaseURL = s.PathSpec.BaseURL.URL() + if s.Cfg.GetInt("liveReloadPort") != -1 { + pd.LiveReloadBaseURL.Host = fmt.Sprintf("%s:%d", pd.LiveReloadBaseURL.Hostname(), s.Cfg.GetInt("liveReloadPort")) + } } // For performance reasons we only inject the Hugo generator tag on the home page. |