[英]Jekyll site works locally but not on Github Pages
I forked the Solid-jekyll theme (solid-jekyll) and got it to work locally. 我分享了Solid-jekyll主题(solid-jekyll)并让它在本地工作。 However, when I pushed it up to Github pages, it seems to loose it's css formatting.
但是,当我把它推到Github页面时,似乎松开了它的CSS格式。
My fork of solid-jekyll is on github, username:BeenzSyed. 我的solid-jekyll的分支是在github上,用户名:BeenzSyed。 I tried changing the baseurl to "/solid-jekyll" but that didn't work either.
我尝试将baseurl更改为“/ solid-jekyll”,但这也无效。
This is what it looks like on my fork: https://beenzsyed.github.io/solid-jekyll/ . 这就是我的叉子上的样子: https : //beenzsyed.github.io/solid-jekyll/ 。
This is what it should like though: http://ojs.xyz/solid-jekyll/ . 这应该是它应该的样子: 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. 我认为这是因为它无法找到_includes / css / style.css文件,但我不知道如何解决这个问题。 Any help is appreciated!
任何帮助表示赞赏!
Faced exactly same issue long back and it consumed 2-3 days. 长期面对完全相同的问题,它消耗2-3天。 Find your main stylesheets ( like main.css ) and save it to assets folder and commit.
找到您的主要样式表( 如main.css )并将其保存到assets文件夹并提交。 This way Github will be copying stylesheet to site built.
这样Github就会将样式表复制到网站构建。 It usually won't copy :( main.css
它通常不会复制:( main.css
I followed the suggestion of dracos on this GitHub Issue page and related commit to change /_includes/head.html from: 我在这个GitHub问题页面上遵循了dracos的建议,以及从以下方面更改/_includes/head.html的相关提交 :
<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. 更改大多数 site.baseurl对relative_url的引用适用于本地测试和GitHub页面。
My commit for changes to my site can be found below: https://github.com/naamancampbell/naamancampbell.github.io/commit/f60da4d4e48447708c2e157ff1e07303d5377587 我对以下网站的更改提交可以在以下网址找到: 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.
我建议在存储库中创建一个新问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.