StochasticNerd StochasticNerd - 1 year ago 104
Sass (Sass) Question

Styles not rendering in Jekyll site

I'm trying to get started with a blog using Jekyll. With Ruby, bundler and gems installation out of the way, I've spun up a site. The problem now is that the styles don't seem to render.
The site's src code is here,

I'm not sure if the problem is because the SASS isn't compiling or the site is just not able to pick up the CSS.
Any help appreciated.

Answer Source

I'm assuming you mean the styles aren't loading when you visit, locally it looks fine.

It's requesting the CSS file at /css/main.css, which is an absolute URL. This absolute URL negates the base path of Blog, resulting in a request to:

But the CSS file is located here:

To fix it, you can add a baseurl option to _config.yml:

baseurl: "/Blog"

Or add that to the url setting (but baseurl is the recommended way):

url: ""
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download