Question about managing baseURL on two duplicate repos

Hello,

If I need to keep two duplicate repos (public for production and private for development, for some reason) with different branches except the same master branches, and want to build them via Netlify, can I use the same baseURL for the two repos? If possible, what would be the best practice?

To my understanding, it seems like it is hard to achieve, by using any of the following:

  • baseURL in config.toml
  • HUGO_BASEURL or $URL/$DEPLOY_PRIME_URL in netlify.toml

If anyone experienced a similar situation and have some clue, I’d appreciate your help.

Thank you.

Same baseURL for two repos only makes sense if they should end up on the same URL, which is rare.

This can maybe inspire:

1 Like

@bep, thank you for the answer.

Other than $DEPLOY_PRIME_URL, could someone let me know what’s the difference between $URL and HUGO_BASEURL on netlify.toml? Is one of them equivalent to baseURL in Hugo’s config.toml?

I am aware that this is off-Hugo question, but could not find clear explanation on Netlify documentation.

You need to understand that Hugo can be configured with OS environment variables. So setting HUGO_BASEURL as an OS env is the same as hugo -b https://example.com.

For Netlify variables, I suggest you read their docs.

2 Likes

Thanks for reminding me of the essential. It has helped me a lot.