Github has been petitioned, begged and implored to enable SSL on custom domains running on Github pages. They finally delivered SSL support with LetsEncrypt.
This is what I had to do for my Github pages Jekyll site at https://www.dblock.org. You can see the changes in www.dblock.org@5f6f047d.
_config.yml
Change url
in _config.yml
to https://www.dblock.org
to fix asset and other internal links.
I couldn’t figure out how to make those relative to either HTTP or HTTPs.
_includes/_enforce_ssl.html
Add a JavaScript redirect to _head.html
from HTTP to HTTPs.
I couldn’t find a plugin that could make a 301 redirect before page load, something that Google recommends.
_includes/_head.html
Include the JavaScript.