
Sign up to save your podcasts
Or


Setting up Hugo, the static site generator, to build my blog with Microsoft Azure.
Last time on The Quest, we mused about trying to merge blog posts, tweets, and videos into one web site. It’s still on my mind, and you can see some of that experimentation in the form of my weekly video posts. (Those posts are built with a Go program I wrote, a part of my “learning Go in 2021” process.)
But I’ve neglected to post yet about the massive blog overhaul I did at the beginning of 2021, which was something I wanted to document for posterity, because it’s already starting to fade from my memory. It’s a big topic, though, and it takes me roughly seven years to write long blog posts these days.
Way back toward the end of December 2020, I had setup the Hugo static site generator to locally build my web site the way I wanted it. Once the files were built, I could upload the HTML files from my hard drive to a web host through ftp, just like the days of yore, but that’s tedious and slow and generally awful. There’s a reason people stopped making web sites that way.
So I started looking for ways to automate the process. There are several places that host “static web sites” through a continuous integration platform. The Hugo documentation mentions AWS, Netlify, Render, Firebase, GitHub Pages, and several others. They all have pros and cons and various pricing structures. Most don’t let you make a free site bigger than around 1 GB, which is pretty small if your site has any images. (Endgame Viable accumulated over 2GB of images in eight years.)
But I stumbled upon a 2019 blog post at melcher.dev that discussed hosting Hugo static web sites on Azure really cheap, or even free if you can stay below a 5 GB free limit. I also found some useful information from a 2019 Medium post by @kurtmkurtm.
Unfortunately, it turns out that Microsoft’s Static Website Hosting is still in testing, which became a big problem toward the end. So I can’t quite use it to host the site yet, but I was able to set it up to build the site.
At least 50% of the information in those blog posts was already obsolete or didn’t apply to my situation, so I had to go off-script quite a bit. Here’s what I ended up doing, to the best of my memory:
After all that I could write posts on my local hard drive, commit them to git, push them to Azure and build the web site with one button press. It made a working Azure static website, but the link was https://endgameviable.z13.web.core.windows.net/. If you can live with publishing a link like that to the world, you’d be done. It’d be fine if you were starting a brand new blog I suppose. Unfortunately I had eight years of blog posts with very different-looking permalinks, and I didn’t want anyone to have to change their links.
So I worked on setting up a custom domain for the Azure static website, which turned out to be a major stumbling block. That’s also when it dawned on me that there is no such thing as an .htaccess file with static web hosting, so redirects are out of the question.
Limitations I ran into:
In the end, I had to keep my Apache shared hosting site, at least for now. I setup an Azure build task to sftp the completed web site to my shared web host (another fun adventure), where I can use .htaccess and the SSL certificates work properly. (SSL certs were a recent addition to my web host, finally.) That’s the current state of the blog.
Whew. I intended that to be a much more polished post with screenshots and everything, because it’s a massive topic. But this draft has been sitting around for five months now and it’s well past time to move on.
Next time, I hope to talk about moving from Azure to Amazon AWS, where many things will become possible, including a plan I’ve hatched to support comments without resorting to a “normal” comment platform.
By Setting up Hugo, the static site generator, to build my blog with Microsoft Azure.
Last time on The Quest, we mused about trying to merge blog posts, tweets, and videos into one web site. It’s still on my mind, and you can see some of that experimentation in the form of my weekly video posts. (Those posts are built with a Go program I wrote, a part of my “learning Go in 2021” process.)
But I’ve neglected to post yet about the massive blog overhaul I did at the beginning of 2021, which was something I wanted to document for posterity, because it’s already starting to fade from my memory. It’s a big topic, though, and it takes me roughly seven years to write long blog posts these days.
Way back toward the end of December 2020, I had setup the Hugo static site generator to locally build my web site the way I wanted it. Once the files were built, I could upload the HTML files from my hard drive to a web host through ftp, just like the days of yore, but that’s tedious and slow and generally awful. There’s a reason people stopped making web sites that way.
So I started looking for ways to automate the process. There are several places that host “static web sites” through a continuous integration platform. The Hugo documentation mentions AWS, Netlify, Render, Firebase, GitHub Pages, and several others. They all have pros and cons and various pricing structures. Most don’t let you make a free site bigger than around 1 GB, which is pretty small if your site has any images. (Endgame Viable accumulated over 2GB of images in eight years.)
But I stumbled upon a 2019 blog post at melcher.dev that discussed hosting Hugo static web sites on Azure really cheap, or even free if you can stay below a 5 GB free limit. I also found some useful information from a 2019 Medium post by @kurtmkurtm.
Unfortunately, it turns out that Microsoft’s Static Website Hosting is still in testing, which became a big problem toward the end. So I can’t quite use it to host the site yet, but I was able to set it up to build the site.
At least 50% of the information in those blog posts was already obsolete or didn’t apply to my situation, so I had to go off-script quite a bit. Here’s what I ended up doing, to the best of my memory:
After all that I could write posts on my local hard drive, commit them to git, push them to Azure and build the web site with one button press. It made a working Azure static website, but the link was https://endgameviable.z13.web.core.windows.net/. If you can live with publishing a link like that to the world, you’d be done. It’d be fine if you were starting a brand new blog I suppose. Unfortunately I had eight years of blog posts with very different-looking permalinks, and I didn’t want anyone to have to change their links.
So I worked on setting up a custom domain for the Azure static website, which turned out to be a major stumbling block. That’s also when it dawned on me that there is no such thing as an .htaccess file with static web hosting, so redirects are out of the question.
Limitations I ran into:
In the end, I had to keep my Apache shared hosting site, at least for now. I setup an Azure build task to sftp the completed web site to my shared web host (another fun adventure), where I can use .htaccess and the SSL certificates work properly. (SSL certs were a recent addition to my web host, finally.) That’s the current state of the blog.
Whew. I intended that to be a much more polished post with screenshots and everything, because it’s a massive topic. But this draft has been sitting around for five months now and it’s well past time to move on.
Next time, I hope to talk about moving from Azure to Amazon AWS, where many things will become possible, including a plan I’ve hatched to support comments without resorting to a “normal” comment platform.