Jekyll on Github Pages not rendering CSS

For my case(not using octopress), When I checked the rendered html in my blog by inspect element, link for css in head tag was this:

'/css/main.css' 

This seems to be in correct to me because css/main.css or ./css/main.css worked on index.html. But it broke things on other post pages.

So, kept the css path to be default BUT changed the root in _config.yml as

root: /

Now, everything works fine on local and after publishing on git with this as root.

But yes, in your case, it is what previous answer told,

root: /octo-5

EDIT: Strangely, I was working with keeping root as / and I am not sure what happened wrong but that stopped working for internal pages. But this below solution works. Note: In default project ofr jekyll, baseurl and url given in _config.yml are commented, so put it according to you.

In case user site

baseurl: /
url: http://USERNAME.github.io

or

In case project site

baseurl: /PROJECT
url: http://USERNAME.github.io

See difference between user site and project site here https://help.github.com/articles/user-organization-and-project-pages/


I'm using jekyll and github's personal website generator. Adding the following code to my _config.yml file below solved the issue of my css not rendering in production. Not exactly sure why though. Would love an explanation. :)

baseurl: /PROJECT
url: http://USERNAME.github.io

Repo: https://github.com/kaeland/kaeland.github.io


In _config.yml, set root: /octo-5.

Call css like the original octopress :

<link rel="stylesheet" href="{{ root_url }}/css/main.css">