What’s this, a code goose blog post!? I’m so sorry..
I’m a bit of a Cloudflare fangirl. All my sites, personal and business, have sat behind Cloudflare for a long time. I tend to convert any new clients or employers to using them for DNS at the very least.
I was initially attracted by the free SSL certificates, but I’ve ended up realising over the years that Cloudflare offer a lot more. Not to mention the fact they must have a pretty awesome marketing department too. Cloudflare merch please?
I’ve recently been meaning to have a play with Cloudflare Pages – their free JAMstack hosting thing. So given that theresnotime.co.uk was just a plain HTML page kept in a GitHub repo, it seemed like a good one to pick for my testing.
I configured the build
To be entirely honest, setting up the “build configuration” was a little confusing, and CF loses a couple of TNT points here.
For plain HTML there is absolutely no setup needed, but that isn’t obvious. A little note suggesting that wouldn’t go amiss…
The initial “build” took a few minutes (which confused me), but once complete I had a
cloudflare.dev staging URL I could check out. So far, so good…
I added a custom domain
I obviously wanted this hosted at https://www.theresnotime.co.uk, and because this domain was already on Cloudflare, adding the custom domain was as simple as clicking a button and automagically adding a CNAME.
I committed a change
As Pages integrates with a git repository, any new commits automatically triggers a re-build.
I watched as everything broke
Okay, so when I did this yesterday I may have made a slight error.. by directing my site to Cloudflare Pages (via that CNAME), this blog (originally at https://www.theresnotime.co.uk/words) was now attempting to be served by CF. Oooops.
Now, I’m sure some clever nerd shit (using a
_redirect file, seeing as I couldn’t add a
.htaccess) would have fixed that, but I had a “simple solution”….
Next up, converting away from just pure HTML to using something like Jekyll…