Jekyll site works locally but not on Github Pages - css

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.

Related

Website posted on GitHub not formatting my CSS

I have placed my CSS and Images folders and index.html on GitHub. Only the html displays without the CSS formatting. I have cleared my cache and cookies. I'm using Chrome. I can't seem to get the CSS formatting to work.
Can anyone help?
uploaded web files to Github: https://github.com/Dennybribri/cv
I have attached a picture of how the top part of the website should look like. Here is a link to the site from Github that just displays the html: https://dennybribri.github.io/cv/
Rename your folder from CSS to css.
The filesystem used on the servers of Github pages sites is case sensitive.
You'll need to import your css from the CSS folder:
<link rel="stylesheet" href="CSS/styles.css">
Also because of the same problem your images will not show up. You will need to specify the path to Images/someimage.jpg instead of images/someimage.jpg
Thank you Mahmoud and Merlin. I changed the folder names to lower case and forever have this issue stuck in my brain. It works great!

GitHub Pages Not Updating CSS

I'm trying to create a website on GitHub Pages, but for some reason, my CSS is taking a very long time to update. I just want to be clear that my CSS does load, it just isn't updating. I tried everything, like clearing the browser cache. But when I go to deployments, my changes were never deployed, and the CSS file https://virxec.github.io/CSWeek/assets/main.css also hasn't updated. The page is here: https://virxec.github.io/CSWeek/MiniGames/ and the file is here https://github.com/VirxEC/CSWeek/blob/master/assets/main.css Is there a way to make GitHub Pages updated CSS files faster? I checked in the commits and it actually says that it hasn't built the page with the edits to the CSS file - only the other pages.
UPDATE: I just waited for a while and then made another small change and then committed it. It updated immediately. Why does this happen? Why didn't it just auto-rebuild?
It looks like you have to bust the cache manually on Github pages.
Here's how I do it in my Jekyll project:
<link rel="stylesheet" href="{{ "public/css/style.css" | prepend: site.baseurl }}?{{site.time | date: '%s%N'}}">
This spits out something like this:
<link rel="stylesheet" href="/public/css/style.css?1634299829608420276">
The timestamp appended after the ? changes on each build which invalidates the cache.

Springboot can't find resources! (Suddenly stopped working)

So the thing is, since I moved my resources (css, images, js) to resources/static folder my stuff started working.
Until I created a new .html page (meant to be dynamic) and pasted in resources/templates. Then all my resources (css, images) stopped working (can't be found) and I can't make it work again.
I'm using SpringBoot + Thymeleaf and the code can be found at GitHub
I couldn't manage to find a solution after 3 hours of searching, that's why I'm here. Thank you, hope you guys can help :/
Edit (some images):
My project structure
The link:
<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css'/>
<link href="css/bootstrap.css" rel='stylesheet' type='text/css'/>
What happens (was working before, I didn't change anything in the code of listed images)
I'm not sure what happened but after starting deleting/commenting some code I wasn't using anymore I started to get errors and managed to track the next file to "fix" (delete or comment) and after that it worked again.
Looks like something in the application wasn't right and it didn't give me any erros so I had to manually try to find it.
I'll keep updating this thread if I find anything useful related.

Jekyll on Github Pages applying css styles inconsistently

I am not sure what's going on, but my personal site - built with Jekyll and hosted on Github pages - has been exhibiting odd css styles behavior as of the last few weeks or so.
I originally set it up on Jekyll 1.something-or-other. I am aware that it is at 3.something now and for the longest time, through 2 etc. I have not had a problem with the styles, everthing was fine up until less than a month ago.
I have not made any changes to the styles configuration for a couple years, but now it is only rendering the styles for the pages (Homepage, About Page, list pages for archives, etc.). But on the actual posts, it drops all the styles - looks like raw markdown and images and no layout.
I have updated jekyll to 3.1.2 on my local machine, and what's even stranger is that when I run it locally, it builds fine and all, but the problem is the opposite. That is, all the posts are formatted with the appropriate styles, but the pages (again - Homepage, about page, archive list) are unstyled.
Again, no changes in any configurations. Is there some obvious places I should be looking? I am using the jekyll bootstrap theme that's a little customized. but not much.
Site is http://subtxt.in
I found your repo and poked around. There is a lot going on there, it seems overly complex.
Using Chromes dev tools you can see the problem is with the css loading - on good pages the correct path is: <link href="/assets/themes/the-minimum/css/style.css" rel="stylesheet" media="all">
On posts where it doesn't work it is: <link href="/assets/themes//css/style.css" rel="stylesheet" media="all">
Note the missing theme name - the-minimum.
In your repo I can't quite figure out the logic, but you could simplify it I think. This file - _includes/themes/the-minimum/default.html I believe contains the head section for all pages.
The line <link href='{{ ASSET_PATH }}/css/style.css' rel="stylesheet" media="all"> I think is the problem, `ASSET_PATH seems to come back with different values. Try just hard coding it to be the correct path like:
<link href="/assets/themes/the-minimum/css/style.css" rel="stylesheet" media="all">
I'm not 100% sure this will fix it, but I think it will.
I would add a link to your repo if this doesn't fix it for you so other people can check it.

Can't get site.baseurl to work in jekyll

I'm creating a GitHub project page with Jekyll.
I've read the previous questions on this subject, as well as the Jekyll documentation here.
I've tried setting baseurl in _config.yml to both /my-project
and
http://myaccount.github.io/my-project while linking my CSS and js files like so:
<script src="{{ site.baseurl }}/js/javascript.js"></script>
<link href="{{ site.baseurl }}/css/style.css" rel="stylesheet">
When I run jekyll --serve --baseurl '' everything looks good on localhost.
But when I push to github, all of my CSS and js files are 404ing; the links are getting turned into http://css/style.css and so on.
What am I missing here?
I'm also confused about the purpose of the BASE_PATH variable in _config.yml, as opposed to baseurl.
I tried setting BASE_PATH and linking my files that way, but that didn't work either.
I figured it out -- baseurl wasn't getting parsed because I had mistakenly placed it under the JB: hash in _config.yml. I moved baseurl to a different part of the file and it's working properly now.
try using baseurl instead. That's what I use.
see https://jekyllrb.com/docs/configuration/default/
You can try and create a new variable in the config file,
newbaseurl: /
and use it instead of baseurl, this seemed to fix my issues.
I fixed a similar issue by changing site.baseurl to relative_url as per: Jekyll site works locally but not on Github Pages
Trying newbaseurl: / did not work for me.
I had a same issue and I created a new variable in inside _config.yml
resource: https://name.github.io/myapp
Then I used that variable like this
<link rel="stylesheet" href="{{ "/style.css" | prepend:site.resource}}">
Also please remember to build before push to the remote. Run this to build
jekyll build

Resources