Fix asset paths when baseURL has sub-folder#103
Conversation
|
Thank you, @anthonyfok I'll try to go through this tonight. I've been totally swamped this week. |
|
You are very welcome @budparr! No hurries, nothing urgent, whenever you have time. On second thought, relURL would work just as well absURL, and would make the generated HTML files slightly smaller, but that is entirely your preference, of course. :-) |
|
I typically use relURL. Not sure why I would have done differently here. |
e98bcc5 to
d013825
Compare
It might be due to @anddongyangli's suggestion in #97 where he said: "We might want to set absolute URLs for these assets based on the configured I have changed the |
|
@budparr Ping. (Demo at https://themes.gohugo.io/theme/gohugo-theme-ananke/ still broken) |
|
Actually, forget my "ping" for now, especially if you are busy. Now I am suspecting that Hugo's absURL is buggy because its current behaviour differs from that in Hugo 0.14. In the current release, relURL is fine with a leading slash, but absURL is not, and that is inconsistent. Hmm... Need more investigation. |
|
Thank you @anthonyfok I'm actually fine with the change, I just haven't had time to run it myself, which I try to do. But I'm going to merge this since that's broken. Thanks for keeping on me about this. |
Hi @budparr,
https://themes.gohugo.io/theme/gohugo-theme-ananke/, a case where baseURL contains sub-folder, is not rendering correctly. It appears that absURL behaves differently when the path is prefixed with a
/slash. The fix is to simply remove that leading slash.The documentation at https://gohugo.io/functions/absurl/ does not seem to mention this fact explicitly. Maybe we should fix the hugoDocs too.
See also #97
Thanks!