Hugo Website Homepage URL Still Points to localhost Despite Valid baseURL in hugo.toml

177 views Asked by At

I'm currently experiencing an issue with my Hugo website where the homepage URL is persistently pointing to localhost:1313, even after setting a valid baseURL in my hugo.toml file:

baseURL = "https://example.org/"

Upon inspecting the page source, the link in the header appears as follows:

<a href="http://localhost:1313/" accesskey="h" title="Pramod Choudhari (Alt + H)">Pramod Choudhari</a>

I've verified that the baseURL in my configuration is correct. Can anyone help me understand why the homepage URL is not reflecting the configured baseURL and is still showing localhost in the page source? I'm using the Hugo PaperMod theme.

TIA!

1

There are 1 answers

1
pramod On

I found the solution here It appears that the baseURL setting is ignored when running Hugo with the hugo server command. To override the baseURL, use the following command

hugo server -D --renderToDisk --baseURL=https://example.org/ --appendPort=false