Reputation:
I am building a blog for myself using Jekyll, however, when I open the page in my browser, the SCSS fails to load. I try to navigate to the SCSS file through my browser but to no avail, the browser believes that the SCSS does not exist.
Here is how I add the stylesheet to the HTML:
<link rel="stylesheet" type="style/css" href="/_sass/_base.scss">
I did this to all of my stylesheets, and yet the it doesn't work.
Does anyone know how to fix this problem? Thank you in advance.
Upvotes: 0
Views: 1585
Reputation: 5444
You do not link to stylesheets with an href to "/_sass/_base.scss"
.
Instead you should do the following:
css/
.then add an empty stylesheet with an empty front matter block (required)
---
---
// this is an empty stylesheet named "style.scss"
// use @import here to load partials from your _sass folder
import your partial(s) into the above "stylesheet".
---
---
// this is an empty stylesheet named "style.scss"
// use @import here to load partials from your _sass folder
@import "base";
@import "mixins";
link your HTML page with the stylesheet:
<link rel="stylesheet" type="style/css" href="{{ 'css/style.css' | relative_url }}">
...and done!
Takeaways:
_sass
into a "dedicated stylesheet"..css
extension even if your source file was css/style.scss
or css/style.sass
relative_url
filter instead of using {{ 'css/style.css' | prepend: site.baseurl }}
or {{ site.baseurl }}/css/style.css
Upvotes: 2