aboutsummaryrefslogtreecommitdiffhomepage
path: root/commands/server.go
diff options
context:
space:
mode:
authorJoe Mooring <[email protected]>2024-04-13 09:22:19 -0700
committerBjørn Erik Pedersen <[email protected]>2024-04-13 22:16:00 +0200
commit09eb822822b9f2881fa33391311f1e38a3ee4a48 (patch)
tree917bbd227f599018ccf99a8f33a965b5de719a43 /commands/server.go
parenta6e84391760ca3786bf580344e2a013ac54b4b4a (diff)
downloadhugo-09eb822822b9f2881fa33391311f1e38a3ee4a48.tar.gz
hugo-09eb822822b9f2881fa33391311f1e38a3ee4a48.zip
hugolib: Display server address after each rebuild
Closes #12359
Diffstat (limited to 'commands/server.go')
-rw-r--r--commands/server.go10
1 files changed, 5 insertions, 5 deletions
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
})