Closed rebelwarrior closed 4 years ago
hey there, it doesn't work like that. When you generate hugo
you need to specify the baseURL that you want to publish. then after generate the public folder, you need to upload the file there. then it will work.
Figured out what was going on.
This blog explains it:
https://alison.rbind.io/post/2019-03-04-hugo-troubleshooting/
Sent from my mobile
On Aug 20, 2020, at 12:58 AM, Evan notifications@github.com wrote: hey there, it doesn't work like that. When you generate hugo you need to specify the baseURL that you want to publish. then after generate the public folder, you need to upload the file there. then it will work.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Basically what happens is that if the baseURL is set to "/" then the css, js and image (img) files look for files with a double "//" in them. This fails and the site looks undressed. To solve this I re-wrote the calls for css, js and img files on the outputted index.html
file in site to remove the preceding "/". So "/img/icon.png"
would be "img/icon.png"
.
This fixes the problem.
When you go to output for deployment rather than testing locally set the baseUrl correctly to the website's site.
When I use hugo server the site looks fine when I use hugo to build the site on public, the css and js don't load and the site looks like a skeleton. Tried using a baseUrl of "/" as recommended. Same result.