Building the foundations

When you're building something, you want to start with strong foundations, but in this case, it wasn't my focus. I wasn't so focused on building time proof foundations for a personal website. Instead, I focused on creating something easy to use with little overhead.

Initially, I wanted to use little to no javascript because a simple blog really doesn't need it. I thought about using a framework like JekyllMiddleman, or 11ty, something bare-bones that outputs a few files that I can serve from anywhere. However, in the end, I opted for my usual go-to stack of Next.jsTypeScript, and Now. I like to avoid the overengineering that usually comes with frontend development (if you're not careful) and Next.js makes that rediculously easy.

I'm not losing any of the speed statically serving gives you because Next.js allows me to render a React application directly from the server. No loading indicators or waiting for scripts to execute. For the most part, it's the same experience for the person reading, with or without javascript. There's a lot of other great things about Next.js including fantastic documentation and heaps and heaps of examples, but I'm not going to list them all here.

So, once I had the base of the foundations, the next part for figuring out the content process. To start, I wanted to make it as simple as possible and set out to use MDX (React flavoured Markdown), allowing me to create a simple Markdown file for each of my blog posts. However, this meant that each time I wanted to post a new article, I would need to add it to the repo on Github. Not ideal if I wanted to be able to post on the fly. I was going to need something a little more dynamic.

Enter Contentful, an API-first Content Management System. Contentful allows me to create all my content in one place and fetch it from my site regardless of the technology used. There are a few similar products available, one being Prismic. I honestly didn't spend any time evaluating the best product to use and chose the one that was more or less familiar to me.

With all the decisions made, I was able to pull together the initial version of the site in under a day and have my first two blog posts live. I used a couple of other interesting libraries and learnt a few things along the way, but I'd like to write about them technically on their own.