blog
Nov 20th 2016

Free static hosting with HTTPS

GIthub pages is a pretty great feature of Github. Free static hosting using a URL they provide, or you can wire in your own. Use their template starters, or publish static content to the gh-pages branch. A lot of people use this in conjunction with Jekyll to create blogs and sites.

It may not be obvious at first, but the HTTPS secure hosting that Github provides only applies to the domains they grant you. They aren't offering SSL certificate hosting for any custom domain that you point there.

This is where Cloudflare can be of use. Cloudflare's free tier is perfectly suited for a small personal site that you want to serve over HTTPS, beyond that it also will provide caching for even faster load times.

For my particular interests in running this site, I wanted to use Kirby as a CMS for streamlined editing, but only locally. Kirby isn't meant to be used this way, it's usually put on a server that supports PHP, so that site owners can edit the content over the web. The creator of Kirby has made a little script he calls statify for the purpose of outputting a static site from Kirby.

So my current setup is a gulp config that does various build tasks, but also has an option to "deploy" which generates the static version of the site, and pushes it up to a specified location in Github. Cloudflare then caches and serves the site over HTTPS to provide the best of all possible conditions for me, without actually costing anything.