mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-01 18:53:18 -05:00
Correctly print server URL when base-url is specified in the command line
When running hugo server like: $ hugo server -s docs -b myhostname the printed output now directs to http://myhostname:1313 instead of (invariably) http://localhost:1313. As per server(), BaseUrl is never empty, and the required value is always found in Viper.
This commit is contained in:
parent
2194cc77de
commit
0053be979a
1 changed files with 1 additions and 5 deletions
|
@ -79,11 +79,7 @@ func server(cmd *cobra.Command, args []string) {
|
||||||
func serve(port int) {
|
func serve(port int) {
|
||||||
jww.FEEDBACK.Println("Serving pages from " + helpers.AbsPathify(viper.GetString("PublishDir")))
|
jww.FEEDBACK.Println("Serving pages from " + helpers.AbsPathify(viper.GetString("PublishDir")))
|
||||||
|
|
||||||
if BaseUrl == "" {
|
|
||||||
jww.FEEDBACK.Printf("Web Server is available at %s\n", viper.GetString("BaseUrl"))
|
jww.FEEDBACK.Printf("Web Server is available at %s\n", viper.GetString("BaseUrl"))
|
||||||
} else {
|
|
||||||
jww.FEEDBACK.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")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue