Hugo: localhost still used when I do hugo server --bind="0.0.0.0"

Created on 16 Nov 2015  路  3Comments  路  Source: gohugoio/hugo

Hi,
When I do hugo server --bind="0.0.0.0" on a remote computer, then access it at http://myserver:1313, my CSS file is still linked to as <link href="http://localhost:1313/css/site.css" rel="stylesheet" type="text/css">, not http://myserver:1313/css/site.css as expected. I'm referring to the path as "{{ .Site.BaseURL }}css/site.css" in my layouts/partials/header.html. Is this a bug in hugo?

$ hugo version
Hugo Static Site Generator v0.15-DEV BuildDate: 2015-10-19T16:14:44-04:00

And here is my complete hugo site: https://github.com/ccnmtl/digitaltibet

Most helpful comment

I found a way to fix this: Pass in your hostname as well with --baseUrl:

hugo server --baseUrl=myhostname --bind="0.0.0.0"

All 3 comments

I found a way to fix this: Pass in your hostname as well with --baseUrl:

hugo server --baseUrl=myhostname --bind="0.0.0.0"

cab this be achieved with out using ? --baseURL ? my route is dynamically decided

As of today, --bind=0.0.0.0 works here.

Was this page helpful?
0 / 5 - 0 ratings