Hi there! I’m encountering some problem that doesn’t seem to be discussed anywhere.
I’m trying to publish my website using jekyll on github, I’ve tried Github Actions, but after that didn’t seem to work at all, i went back to publishing from branch. I’ve made a specific branch for this, called gh-pages.
I’m aware a common mistake with jekyll is not linking your css properly. I’ve had that, and my css was completely empty. However, when I follow the instructions, instead of my style.css file, only normalize.css from necolas on github loads!
I’ve been trying to get it to work for hours now, but I have no idea what’s going on. I get that normalize.css is being enforced by github, but that means that my link is correct and still no dice.
It’s not a browser cache issue, I’ve tried clearing it multiple different ways.
I’m not sure where the normalize file is coming from, best guess is the site is not actually building/serving off that exact repo. Check in the GH dashboard if there are build errors and verify you have it all set correctly to serve the gh-pages branch.
When you have multiple branches and are using gh to serve it can be hard to tell what is going on cause one little issue could mean you are looking at one branch for changes but they are happening in another. Or the build is failing and you are not noticing and it is continuing to serve the last successful build.
An easy test would be to change some text on the index page in that file and see if the web page shows that change.
This is based on the one I use for my site, and I know it works. With this you don’t need to track the _site/ directory. Only keep the usual jekyll structure on your main branch, and when you push code to it it will automatically build the site and publish it for you.
Hello @matak12m, the primary issue seems to be your use of @use "theme"; in assets/css/style.sass. Like @rdyar mentioned in their comments, @use is not a valid keyword in the Sass Engine used by classic GitHub Pages workflow. Moreover, the terminal semicolon ; is not a valid .sass syntax either (But is for .scss files).
So, GitHub Pages injects stylesheets from its default theme name Primer, the same styles used in GitHub light mode. This is why you see normalize.css in the built style.css.
Yes @import is deprecated. But this development is from modern Sass engine (not 100% backwards-compatible with legacy Sass engine bundled with classic GitHub Pages workflow).
(You can see various places in the Sass docs that indicate a given feature not being supported by Ruby Sass.)
The classic GHP workflow is itself locked to these versions and won’t be using newer breaking-incarnations of its dependencies in order to avoid breaking countless number of sites (managed by lay-persons who are not tech-savvy).
So, your choice is to either lock yourselves to the classic GHP enviroment (can be emulated locally using the github-pages gem) or migrate absolutely to a relatively more modern Jekyll stack and depend on GitHub Actions to build and deploy your site.