Hello. I have empty baseurl in config, because I want to use this site on 2 domains.
But in sitemap.xml baseurl empty too and I have links like
/ru/blog/g-core-labs/
Google requires that the link be full +
How to do it?
I would stop thinking to hard and set the baseURL and build the site twice.
I agree. But I would like automation. To do this, I would like to have a variable that would always put the domain in the sitemap.
I just check the site on the test domain first, and then I publish it on the main domain. The empty baseurl parameter gives me a plus in that I’m not attached to a domain. But I always want to generate a map of the site with a given domain.
I’m pushing to three servers simultaneously using three generate lines in a zsh
“deploy” function.
See this gist for the basic idea, and click through to my actual .zshrc
.
Having it specified in the hugo
command arg will override the baseURL
in the config, so you just do it however many times you need, then push to your site folders.
I understand, but I have the following sequence:
- Generating the demo site testsite.com
- Checking the site’s performance
- Copy the site testsite.com to the main site site.com.
That’s why I do not want to be attached to testsite.com (ie baseurl should be empty), but sitemap.xml must contain URL-site.com.
When you build your site, pass the baseURL in as a flag. Or check for an env variable. Your steps are too abstracted for me to provide you with any real concrete examples.
Can’t you check perf locally?
@igramnet what you are asking does not make sense. Adapt your sequence: The duplication of the site will not have any effect on your performance and it will make a much simpler mental model, even a possible one …