No CSS via hugo server?

I feel like I just missed something major at some point, but I currently have a main.css file in the static folder, and in my header.html partial, I have: <link rel="stylesheet" type="text/css" href="/css/main.css">. You know, normal CSS stuff.

When I build the actual site, the CSS shows up in the public folder, like it’s supposed to. However, when I’m accessing it via the local hugo server, the header content is there, but the CSS is nowhere to be found and the site looks like a mess. Google has thus far failed me in trying to figure out why…any ideas?

Two ideas:

  1. Check with Firefox or Chrome tools if you’re getting a 404 on files
  2. Confirm your site baseurl

See this: http://keshavabharadwaj.com/2016/03/15/hugo_theme_not_rendered/

I’m getting a 200 on CSS files and it shows up in sources just fine…

It’s not anywhere on the internet yet, so I don’t have the baseurl specified. Just developing locally for now. (Or trying to, at least.)

Never mind, it was a really dumb mistake on my part–I somehow omitted the spaces in my CSS selectors.

Let’s pretend like this never happened. :wink:

1 Like