From 09eb822822b9f2881fa33391311f1e38a3ee4a48 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sat, 13 Apr 2024 09:22:19 -0700 Subject: hugolib: Display server address after each rebuild Closes #12359 --- commands/server.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'commands') diff --git a/commands/server.go b/commands/server.go index 09fb4e79f..ccd2bde7d 100644 --- a/commands/server.go +++ b/commands/server.go @@ -237,9 +237,8 @@ func (f *fileServer) createEndpoint(i int) (*http.ServeMux, net.Listener, string listener := f.c.serverPorts[i].ln logger := f.c.r.logger - r.Printf("Environment: %q\n", f.c.hugoTry().Deps.Site.Hugo().Environment) - if i == 0 { + r.Printf("Environment: %q\n", f.c.hugoTry().Deps.Site.Hugo().Environment) mainTarget := "disk" if f.c.r.renderToMemory { mainTarget = "memory" @@ -569,7 +568,7 @@ func (c *serverCommand) PreRun(cd, runner *simplecobra.Commandeer) error { } } - if err := c.setBaseURLsInConfig(); err != nil { + if err := c.setServerInfoInConfig(); err != nil { return err } @@ -614,7 +613,7 @@ func (c *serverCommand) PreRun(cd, runner *simplecobra.Commandeer) error { return nil } -func (c *serverCommand) setBaseURLsInConfig() error { +func (c *serverCommand) setServerInfoInConfig() error { if len(c.serverPorts) == 0 { panic("no server ports set") } @@ -641,7 +640,8 @@ func (c *serverCommand) setBaseURLsInConfig() error { if c.liveReloadPort != -1 { baseURLLiveReload, _ = baseURLLiveReload.WithPort(c.liveReloadPort) } - langConfig.C.SetBaseURL(baseURL, baseURLLiveReload) + langConfig.C.SetServerInfo(baseURL, baseURLLiveReload, c.serverInterface) + } return nil }) -- cgit v1.2.3