Skip to main content

New Site michaelkelly.ai, Blowfish and Static Website Automation

·437 words·3 mins
Michael Kelly
Author
Michael Kelly
Sydney-based Solutions Architect. Hobbies include running, cycling, woodworking and 3d-Printing.

Background image generated using Fooocus.

My AWS Community Builder renewal is coming up so I thought now was a good a time as any to redo my Hugo blog, pick a more relevant domain (michaelkelly.ai over ashiny.cloud) and do housekeeping/automation to get it up to speed with modern features (it has been 2780 days since I last updated ashiny.blog, 29 July 2018 to 9 March 2026).

The site still uses the static site generator Hugo but I’ve now gone with the Blowfish theme (Github repository here, thank you nunocoracao).

I experimented with a few different Hugo themes including PaperMod and Book but came back to Blowfish for it’s clean interface and quality of life features like dark mode, blog organisational tools (tags, time needed to read, table of contents) and integrations with other services while still providing a lot of simplicity for a blog out of the box.

In setting everything up I also went through possible domain names, after a few iterations I moved from ashiny.cloud to michaelkelly.ai as the domain was available and it is what it says on the tin, my notes on cloud technologies and hopefully more notes on making use of AI upcoming. An honorable mention included parsimony.ai which I really liked but GoDaddy has.

In the process of setting up this version of my blog everything is fully infrastructure as code, source controlled and end-to-end automated using Cloudformation and Bash scripts. I used a modified version of the set of static website Cloudformation templates available from Samira Yusidova’s blog (thank you Samira).

The main modification I needed to add in which is useful to note is working with website default subdirectory root objects. CloudFront provides a feature to define a default root object, so that when you navigate to the root of the website you’re directed to view a specific file (usually the index.html file). Default root objects do not work for website subdirectories (e.g. michaelkelly.ai/page/about), I had to include a CloudFront Function which triggered on viewer requests:

function handler(event) {
    var request = event.request;
    var uri = request.uri;
    
    // Check whether the URI is missing a file name.
    if (uri.endsWith('/')) {
        request.uri += 'index.html';
    } 
    // Check whether the URI is missing a file extension.
    else if (!uri.includes('.')) {
        request.uri += '/index.html';
    }

    return request;
}

In the case of a visitor navigating to an empty folder on the static site CloudFront will redirect to the folders index.html to avoid 404s and provide a cleaner user experience.

Anyways, this is the new blog, I’ve ported over older articles, if you see any dead links or artifacts let me know, cheers.