My problem is, that the url gets rewritten with the current path of the document and breaks.
We are only using one language, and we don’t use custom link render hooks.
If that matters, we are using the books template:
So here is the correct example:
Should be: https://gitlab.domain.com/basePath1/basepath2/basepath3/-/tree/development/path1/path2/path3/filename
Is (pay attention to the currentPath element): https://gitlab.domain.com/basePath1/basepath2/basepath3/currentPath/-/tree/development/path1/path2/path3/filename
And we are currently on page (if that makes any difference): https://prefix.pages.domain.com/basepath2/basepath3/currentPath/some/path/
While our baseURL is: https://prefix.pages.domain.com/basepath2/basepath3
The target URL is https://gitlab.domain.com/basePath1/basepath2/basepath3/-/tree/development/path1/path2/path3/filename
So toplevel domain is the same, but we got different subdomains. The target file is not even part of the Hugo site.
Thanks for pointing that out, I did not check that. But for me it seems fine, as this is mainly doing stuff with URL that are not “remote” URL (beginning with //or having a : in it)