I’ve put together 2 test sites with baseURLs with subdirs; one with canonyURLs
set to false
(default), and another true
.
Test sites:
-
https://hugo-sandbox.netlify.com/subdir-canonify-true/ | Site source
-
Shows the other subdir test site on the right in
iframe
.
-
Shows the other subdir test site on the right in
-
https://hugo-sandbox.netlify.com/subdir-canonify-true/posts/post-1/ (same links as above but from a post page)
-
Shows the other subdir test site on the right in
iframe
.
-
Shows the other subdir test site on the right in
- https://hugo-sandbox.netlify.com/subdir-canonify-false/ | Site source
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: