Eclipse Preview framework should build the site using the expected preview URL.
For each preview, the Jenkins job is using the default baseurl which is defined in a hugo config file: https://gitlab.eclipse.org/eclipsefdn/it/websites/eclipse.org/-/blob/main/config.toml#L1
With Netlify, we are using the -b, --baseURL string hostname (and path) to the root, e.g. http://spf13.com/
flag to set the preview url.
command = "npm run build_netlify && hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
For production, it's fine to use the default value in the Hugo config but we need to be able to set a unique value for each preview/MR.
*Note: I am using eclipse.org as an example, but this is something that I hope we can fix for all Hugo sites using our new preview framework.
Perhaps, we can configure Jenkins to expose the preview URL via an environment variable that we can then use in our build script: https://gitlab.eclipse.org/eclipsefdn/it/releng/jenkins-pipeline-library/-/blob/main/resources/org/eclipsefdn/jamstack/hugo/build.sh