CSS not loading?

Hi Netlifycommunity,

I’ve been having issues with CSS on my Hugo site. Locally, it works great, but the CSS doesn’t seem to appear on the site an all pages. There are no errors that appear when deploying the site, but it shouldn’t look like this. One issue might be the fact that the theme has two names? But I tried both theme names in the config.toml file while having both themes in the folder.

My netlify site is here and MY github repo link is here.

I’ve read the related questions and I skimmed through the CSS (doesn’t appear to have any random links, and it does work locally, but I’m not the best with CSS)

Can someone look this over for me?

Thanks so much!

Hi, @lexahl, I don’t see any issues with the CSS when I check the site now. By this I mean there are no 404 statuses in the developer tools network tab for the page load for any CSS (or other) files.

Did you resolve the issue?

If you are still seeing CSS issues, please let us know. If so, my best guess is that the build at Netlify and the local build differ for some reason and tracking down the difference will be the key to resolving it.

For example, you can configure the version of Hugo the build system will use with the environment variable HUGO_VERSION.

Again, if the builds still differ, please let us know and we’ll keep troubleshooting.

Thanks for your help on this! I am still having issues. I have a netlify.toml file where I specify the version (HUGO_VERSION = “0.72.0”) so I don’t think thats it, and I’m sorry if it was unclear but I meant that the CSS wasn’t appearing on all pages. It is working on the “home” page, but it doesn’t show up if I click, about, posts, or projects.

hi @lexahl,

i see the issues you are describing:

I am not a hugo expert, but i think the issues you are seeing are connected to a certain variable that hugo uses called “baseurl” - you might have to tweak things a bit for the right resources to be found - at the moment, your paths to your css clearly aren’t resolving on those sub pages.

If you search through the forums for “baseurl” you will see lots of similar posts as to this, and this comment from marcus might be interesting:

Thanks so much!! That was the issue!

I changed baseurl = “” to baseurl = “/” and it works now :slight_smile:

1 Like

awesome! i knew it was something like that =)