You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running command line "hugo" all is fine and the .Permalink in the hugo default template is creating the correct urls in the sitemap using the baseurl set in the config file.
The problem is that IF the last command ran is "hugo server", and then the sitemap in the public folder is transferred to a remote webhost, the sitemap will have invalid links.
Suggesting this be changed to always use the baseurl set in the config for sitemap generation even when running "hugo server" on a local machine.
The text was updated successfully, but these errors were encountered:
However, the behaviour you are seeing is by design. The http://localhost:1313/ baseURL is necessary for your web browser to find the files served by hugo server. If you look closely, it is not only sitemap.xml, but ALL generated HTML are likely to contain hrefs pointing to "http://localhost:1313/", so something is bound to be broken (missing CSS, missing images, etc.), making it unfit for upload to the production server anyway.
Also, end users often run hugo server --watch, which injects LiveReload.js to the web page for instant update to ease web development. This feature is great for the local computer, but not for production.
So yes, it is imperative that a final "hugo" run be made to generate a correct website for upload to the production web server.
Thanks for the help... I was using "hugo" without the same --VARS as when running "hugo server" on the end. Once I set them the same all is well with this.
When running command line "hugo" all is fine and the .Permalink in the hugo default template is creating the correct urls in the sitemap using the baseurl set in the config file.
However, if running "hugo server" the sitemap is generating instead this:
http://localhost:1313/about/
The problem is that IF the last command ran is "hugo server", and then the sitemap in the public folder is transferred to a remote webhost, the sitemap will have invalid links.
Suggesting this be changed to always use the baseurl set in the config for sitemap generation even when running "hugo server" on a local machine.
The text was updated successfully, but these errors were encountered: