简体   繁体   English

我在 github 上的 jekyll 站点没有显示我的 sass (scss)

[英]My jekyll site on github is not showing my sass (scss)

I locally made a jekyll site which works perfectly.我在本地制作了一个 jekyll 网站,效果很好。 Now that I uploaded it to github it suddenly doesn't use any scss of mine anymore.现在我把它上传到 github 它突然不再使用我的任何 scss 了。 In my wrapper.html layout (which I use a layout for the other layouts) I have included:在我的 wrapper.html 布局(我使用其他布局的布局)中,我包含了:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="{{ '/assets/css/main.css' | absolute_url }}" >

in assets/css/main.css is:在 assets/css/main.css 是:

---
---
@import "stylesheet";

And _stylesheet.scss is in _sass/_stylesheet.scss. _stylesheet.scss 在 _sass/_stylesheet.scss 中。 Let me know if more information is needed!如果需要更多信息,请告诉我! What is going wrong here?这里出了什么问题? Thanks in advance!提前致谢!

With Jekyll the two main problems for beginners are:使用 Jekyll,初学者面临的两个主要问题是:

  1. how the theme works/where to find its files and主题如何工作/在哪里可以找到它的文件和
  2. how basurls/relative urls work. basurls/relative urls 是如何工作的。

This problem is clearly the latter.这个问题显然是后者。 Github Pages requires a baseurl, so you cannot link to the domain root. Github Pages 需要一个 baseurl,所以你不能链接到域根。 Therefore the starting slash is incorrect.因此起始斜线是不正确的。 This should work:这应该有效:

<link rel="stylesheet" href="{{ '/assets/css/main.css' | prepend: site.baseurl }}" >

More info for Jekyll beginners can be found in this Jekyll Conference talk . Jekyll 初学者的更多信息可以在这个Jekyll 会议演讲中找到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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