8

I forked the Solid-jekyll theme (solid-jekyll) and got it to work locally. However, when I pushed it up to Github pages, it seems to loose it's css formatting.

My fork of solid-jekyll is on github, username:BeenzSyed. I tried changing the baseurl to "/solid-jekyll" but that didn't work either.

This is what it looks like on my fork: https://beenzsyed.github.io/solid-jekyll/.

This is what it should like though: http://ojs.xyz/solid-jekyll/.

I think it's because it can't find the _includes/css/style.css file but I'm not sure what to do to fix that. Any help is appreciated!

Beenz
  • 153
  • 1
  • 2
  • 7
  • The stylesheets look completely different. https://beenzsyed.github.io/solid-jekyll/assets/css/style.css starts with normalize. There is no normalize in http://ojs.xyz/solid-jekyll/assets/css/style.css – Michael Coker Feb 25 '17 at 00:48
  • Right - I don’t know how or where my fork is picking up that stylesheet from. Both repo’s stylesheet's point to assets/css/style.css which goes to _layouts/style.css and then to _includes/css/style.css. – Beenz Feb 25 '17 at 01:38

3 Answers3

7

Faced exactly same issue long back and it consumed 2-3 days. Find your main stylesheets (like main.css) and save it to assets folder and commit. This way Github will be copying stylesheet to site built. It usually won't copy :( main.css

SACn
  • 1,862
  • 1
  • 14
  • 29
  • 1
    Thanks Sachin! This worked. I ended up moving my style.css to my assets folder and it was fine. – Beenz Feb 25 '17 at 19:07
  • 1
    Thanks @SACn it worked for me too. However this is pretty much manual. I saw other people telling me I should do `git init` in my `_site` folder. Yours are definitely the easier way to do this. But I am not sure which one should be the best practice. – addicted Mar 22 '19 at 13:49
  • Different issue but similar reason for me, I had to change the root folder to `/docs` in pages settings and it worked! Earlier it didn't get the required CSS into the built site. – vishwarajanand Mar 31 '22 at 18:35
3

I followed the suggestion of dracos on this GitHub Issue page and related commit to change /_includes/head.html from:

<link rel="stylesheet" href="{{ site.baseurl }}public/css/poole.css">

to

<link rel="stylesheet" href="{{ "/public/css/poole.css" | relative_url }}">

Changing most site.baseurl references to relative_url works in both local testing and on GitHub Pages.

My commit for changes to my site can be found below: https://github.com/naamancampbell/naamancampbell.github.io/commit/f60da4d4e48447708c2e157ff1e07303d5377587

naaman
  • 900
  • 10
  • 15
0

As someone pointed out, the live demo uses a different stylesheet. So the repo isn't the same. I suggest creating a new issue in the repository.

Sharath kumar
  • 1,118
  • 13
  • 17