rendToDisk creates localhost:1313 path despite baseURL

So I am using Hugo 0.73 along with the ‘Terminal’ theme.
When generating the static files, found in ‘public’ with ‘hugo server -renderToDisk’, all of my hrefs in my index.html and other HTML files, contain localhost:1313 E.g. "href=“http://localhost:1313/assets/style.css”.

This results in no CSS rendering due to the path being incorrect when I push my files to remote server.
In my config.toml, I set baseurl = “” and it still writes the files with local host path as shown above.

Obviously, manually correcting this ever update isn’t practicable! Is this a bug or am I doing something terribly silly here?


Not terribly silly, but when running the server we default to localhost and do not respect your config.toml setting. If you need some other baseurl:

hugo server -b

Bep, I was literally just looking in ‘hugo help’ at -b, --baseURL string and thinking, does that change my config.toml? Thanks for the reply !

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.