Figured out! I did many trial and errors. Kukuku… many are viewing but none are replying. But well… splendid!
Nobody apparently had an answer. You found an answer by trying. I just joined here minutes ago. It would be helpful to hear how you did it
It works, don’t worry.
I use Hugo on two domains in subfolders.
I use following works in my config.toml and it works.
baseurl = "http://example.com/blog/"
But the imags are still broken. Will update if I figure it out.
This is apparently a common issue with no real answer easily found.
could you try looking at the theme to see if there is /js instead of $.Site.BaseURL/js etc., ?
But you then failed to mention what exactly you figured out
In any case, closing the loop; see the solution here:
I finally got around to fix my site
baseurl = "//example.com/blog/"
RelativeURLs=true
CanonifyURLs=true
These are the relevant settings. It seem to work without CanonifyURLs=true
but I read that the two settings interact with each other.
The best way for me to fix the problem is to create a subdomain. Then, even if the web site is physically hosted in a subfolder, the baseurl value doesn’t have to add a suffix with the subfolder name.
As an example:
Physically the site files are stored in www.example.com/blog/
Create a sub domain blog.example.com that points to www.example.com/blog/
In config.toml adapt the value of baseurl (baseurl = “https://blog.example.com/”)
Then it works, images are displayed, path to css is correct, etc…