mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-01 13:58:48 -05:00
If baseurl is set then print that on the command line, else leave as default of localhost
This commit is contained in:
parent
a10519643d
commit
073dd984dc
1 changed files with 5 additions and 1 deletions
|
@ -64,7 +64,11 @@ func serve(port int) {
|
||||||
fmt.Println("Serving pages from " + Config.GetAbsPath(Config.PublishDir))
|
fmt.Println("Serving pages from " + Config.GetAbsPath(Config.PublishDir))
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("Web Server is available at http://localhost:%v\n", port)
|
if BaseUrl == "" {
|
||||||
|
fmt.Printf("Web Server is available at %s\n", Config.BaseUrl)
|
||||||
|
} else {
|
||||||
|
fmt.Printf("Web Server is available at http://localhost:%v\n", port)
|
||||||
|
}
|
||||||
fmt.Println("Press ctrl+c to stop")
|
fmt.Println("Press ctrl+c to stop")
|
||||||
panic(http.ListenAndServe(":"+strconv.Itoa(port), http.FileServer(http.Dir(Config.GetAbsPath(Config.PublishDir)))))
|
panic(http.ListenAndServe(":"+strconv.Itoa(port), http.FileServer(http.Dir(Config.GetAbsPath(Config.PublishDir)))))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue