Why is my main.css being served from http: instead of https:?

I forked minimal-mistakes a couple years ago, and now I’m finally trying to force SSL on Github. When I go to the https version of my site, it seems to reference http://[site name]/assets/css/main.css instead of https:, and of course does not render properly.

I thought that I’d eliminated all http: references from _includes and elsewhere. Any clues for me?

I’m considering trying to merge with the latest minimal-mistakes, but I expect that won’t be simple either.

Sorry if this has been covered before. I searched and didn’t notice any posts about this problem exactly.

do you have a link to the site? my guess is the http is hard coded somewhere, did you check the layouts too?

Yes, I switched all files in _layouts to use https.

I found this in _includes/head.html
<link rel="stylesheet" href="{{ '/assets/css/main.css' | absolute_url }}">

So I guess I need to find out how mmistakes computes absolute_url?

absolute_url is a Jekyll construct. My guess is you need to setup your GH pages repo to force https and/or make sure url in your _config.yml has a https:// protocol and not http.


Also since you noted using MM several years ago it’s worth making sure you’ve upgrades to latest version to rule that out as well. The theme absolutely works with https. The demo site is served on GitHub Pages that way.

1 Like

FIXED. Thank you. Previously I had left url in _config.yml blank for some reason – maybe I thought it would interfere with development on localhost:4000. With the url populated the site now works properly on GitHub Pages.

I will now set it up to force https.

Mr. Rose, I would like to take your latest version of minimal-mistakes some time, but I’ve been nervous about the effort to merge my changes back in.