BaseURL path (subdir) sometimes ignored by relURL, absURL

I’ve put together 2 test sites with baseURLs with subdirs; one with canonyURLs set to false (default), and another true.

Test sites:

Note that even if they look like just 2 regular pages, they are technically separate Hugo sites.

Pinging @bep to hopefully chime into this… but the issue I faced for an internal webpage at work was that the links did not work the same way when switching from canonifyURLs true to false… many links broke… as we see in the above 2 test cases too.

My understanding is that canonifyURLs should only change the link aesthetics… absolute URL vs relative URL… should it also change the whole link generation behavior too?


Little post on my Hugo Sandbox site linking to those 2 sites.


Just revisited my notes:

So I had to stick with canonifyURLs = true for that internal site I referenced earlier, because it broke all the figure shortcodes that looked like below (when canonifyURLs = false):

{{< figure src="/images/foo.png" >}}

as we see here: