Generate sitemap without localhost

So I generate the public folder with the following command -
hugo server --renderToDisk

But when I inspect the public folder, I find the sitemap.xml uses localhost:1313 as base domain.

But in config.toml file, the base url is given as the domain itself -
baseURL = "https://exampledomain.com/"

What is wrong? Do I need to specify the baseurl somewhere else for the sitemap to generate it with the custom domain?

Thanks in advance.
`

Hi, you could pass the --baseURL option. Or just run the plain hugo command

Thanks @zwbetz ! I did not realize generating the public folder could be as simple as just hugo

I can confirm the xml files are now generated with the correct baseurl that is set in config.toml

By the way, I am a fan of your blog posts! They have helped me a lot when groking hugo.

1 Like

Happy to hear that :black_heart: