Css doesn't load on github but load on localhost


#1

Hello everyone
I search for my issue but i can’t find any answer so i make new topic. my site load on localhost but when i push it to github. my site load but without any css. I think my config.yml has issue. I use this config for sass

sass:
  sass_dir: _sass
  style: compressed

#2

it is most likely a baseurl problem. When hosting on GH your site is in a sub directory of your username if you are using a project repo.

In your config do you have baseurl set to your repo name?

A link to your repo would be helpful.


#3

my baseurl is

baseurl:        /Blog.github.io

and my site isn’t in sub directory. my repo is https://github.com/behroozramezani/Blog.github.io


#4

that is a weird/bad repo name I think, and I bet the extra TLD in the url is going to totally whack it out. Can you just have your repo be named blog?

it works locally cause jekyll serve is smart and knows you are local so it doesn’t use it.


#5

Yes i change name repo


#6

Check your config and look at your site_url and base_url


#7

Hi,
I just installed a new 3.6.2 Jekyll site, and had this issue of css not rendering (on github pages project repo), fixed by filling the baseurl with the blog’s name. Couldn’t this be automated on install? for example jekyll new -sub myblog to inform Jekyll the install is on a subdomain and put “myblog” in baseurl, or something like that.
Or at least wouldn’t be good to add a note on the Quickstart Documentation?