I am having a TON of problems getting my Hugo Fuji site working. Everything renders correctly in the Hugo server.
But when I build the pages, they no longer have CSS. The page looks somewhat correct when opened from the public folder, but it is missing style.
When I deploy it to my Netlify site it looks completely broken. Style/formatting is not correct.
This is what the top of my config.toml file looks like:
I have tried doing baseURL = "/" and baseURL = "https://nickplatt.dev/", but that still does not work.
I get 404 errors in the console for all of the CSS and JS files.
I do not know why this is happening because I drag and drop my files directly from the public folder to my website’s deploy files.
I am not sure why domain/asses/css/fuji.min.css is not working when I can see the folders/files where they need to be. I am also not sure why this isn’t working when just opening the index.html files from the file explorer.
Why does it work flawlessly in the Hugo server, but does not run correctly at all either from file explorer or on my domain?
Link to files: blog/blog at main · tpbnick/blog (github.com)
I think something bigger is wrong because all posts I click on error out. They all say “Page not found” when the URL, for example, https://nickplatt.dev/post/pythonpuzz/ does not work, but /post/pythonpuzz/ does have an index.html file in the file explorer. I am just unsure why nothing works after running the hugo command to build the HTML pages but works completely fine in the hugo server.
Check your Netlify settings (no guarantees you get help from the Hugo forum about Netlify specifically). Note the Hugo docs on deploying with Netlify: Host on Netlify | Hugo
Is there any particular reason you are drag and dropping your public files instead of having Netlify build them?
Once you run hugo, the URLs referencing your assets will be relative to your baseURL. Since they don’t exist online/on the server yet, they 404.
BTW as of time of writing, your website at https://nickplatt.dev is 404.
First thought was that assets folder is not copied over to public by Hugo. But with targetPath Hugo will create a separate “assets/…” folder structure in public, nothing to to with the actual “assets” folder in Hugo.