So there have been numerous attempts to make this page as “serverless” as possible lately. So much so that I’ve actually shut down my last legacy linux machine entirely as of this post. In previous posts I’ve covered moving from ghost to hugo as my main content management system of choice and how that led me to basically only need static hosting. With that I started getting tagged with fees from aws now that I was out of the free tier. I knew this day would come, and I figured whatever charges started to come up would motivate me to move to the next thing.

Well, movitvation successful! Thankfully cloudflare has made this alarmingly simple to do. Since the site is already generated by hugo, already in a git repository, and already ready to be ready already, everything just worked. First was going to the cloudflare dashboard to import my domains from route53 into cloudflare. Simple enough, the wizard even imported the DNS settings as they stood in the initial conversion, which was nice as I didn’t have to go and scrape and paste those in manually for the various DNS TXT challenges that exist for the domain already.

That was a breeze, change the nameservers at my registrar (note, I should change to using cloudflare as my registrar too …), and click a few things on the dashboard and I’m on cloudflare now! So that was a great first step, and I didn’t do any proper pre-planning before jumping into this, so away we go I guess. There are all sorts of guides on how to setup a hugo site and how to get it into gitops and this isn’t one of those. I had a hugo site in github already, so I just imported it into cloudflare’s pages interface.

WHAMMO ERROR

OH NO

I knew this wasn’t going to be as easy as I had assumed it would be, I settled in for hours of debugging and went into the error message. It was my theme complaining about the version of Hugo being used, being too old. And right there on the example of things you can do is set environment variables. So … HUGO_VERSION was set to 0.101.0 and I hit the rebuild button, and it took off. Then out of nowhere https://amiblocked-website.pages.dev was on the internet and that was it. Yup, just tell it to use a specific version, just like it said in the directions you could, and I’m online.

So, that’s cool, and I like it, but the point was to host the page on the domain I purchased for the project in the first place and I went to poking around. Almost 8 minutes later of looking in the wrong place, I did a quick search and then found a screen capture of the pages dashboard for custom domains. It’s right there, next to deploy, you can’t miss it unless of course you are me, then you miss it every time. I typed in the domain I wanted to attach to the page, cloudflare saw it was in my domain list, made the appropriate page and DNS changes and I was online.

So that’s full static site hosting, DNS hosting, and full SSL support, for a grand monthly total of $0.00 USD