cssjekyllgithub-pagesjekyll-bootstrap

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


Solution

  • 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.