简体   繁体   中英

Jekyll site works locally but not on Github Pages

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!

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM