Since I didn’t manage to write blog posts regularly enough in the last few months, I forgot how to deploy the changes to my website. Luckily I documented how to do all of the steps in my previous blog posts! I guess that is the benefit of a system like Wordpress or Drupal, where the authoring is a bit more straightforward out of the box, at the cost of the simplicity of managing patches for a static site of course…
Initially I setup Google Analytics because I had used it before on a previous project, and spotted that there is a Hugo integration. But I got thinking that there must be information about how to use the information straight from CloudFront. This great article confirmed my suspicions!
Google Analytics Setting up Google Analytics with Hugo is as simple as adding your Google Analytics id to the config.yaml. I didn’t look into whether this then assumes that the theme you are using also supports this, or whether there is other magic so that it ‘just works’.
Hugo works! The Deploy is a really nice touch. Fixes loads of stuff that I have no clue about, at least to a reasonable first approximation (see e.g. SEO, GDPR, etc).
Git the generated source A small philosophical question around whether it makes sense to check in the public directory to my git repo. That would basically provide an archive of what was deployed at each stage. At this point I’m tempted to do this, since it ‘costs’ very little effort and I can’t see any real downsides.
In the previous blog post I talked about how I created the static pages for hosting on AWS S3. Since you’re reading this, you might be interested in how I registered the domain and got things deployed. If you want to see how I think you can do this best, read the article backwards since this is the solution that I used in the end. Read from the front of the article if you want to know how I got there!
I had a few simple criteria for the website, which is primarily for hosting blog type content. I wanted to be able to manage the source using version control, it should be able to be deployed as a static website so that I could publish it using AWS S3. Generating the static source should be easy to do using a docker container. Of course, the site should look modern and allow me to customize it fairly easily if needed.