A Brief History of My Blog's Tech
Roughly five years ago, I restarted my blog using Jekyll, hoping to write about interesting things others might find useful. After using Jekyll for about a year, I moved to the static site generator Hugo, and it worked fine for the next four years. Today's post is an update regarding my move away from Hugo.
I initially went with Hugo for the easy setup and quick content processing time. Hugo worked well for me for a while. With each update, there were changes to syntax, configuration, and more that gradually built up some technical debt on my blog that I knew I should address, but didn’t. On top of that, some of the customizations I wanted were tricky and required research and testing, it quickly became more than I wanted to manage.
In the spirit of my original post I decided to try another static site generation tool that I felt more closely fit what I wanted at this time. That tool is Next.js.
I decided to use Next.js because already make use of it on several other projects. I feel confident in my understanding of the project and my ability to customize it going forward since it is essentially Javascript and React. At this point in my life, minimizing the cognitive load of my blog’s maintenance was more important to me than the speedy content generation I got from Hugo. Speaking of reducing cognitive load - I set up a workflow on Github to automatically build & deploy the site when I push to main
, so one less thing to keep in my head as well.
Migrating content to Next.js
Migrating to Next.js was not a simple switch, but it also wasn’t overly complicated. Moving my markdown content from the old Hugo project to the new Next.js project was straightforward, but updating the metadata was time-consuming.
Nginx Config Tweaks
I added 301 redirects to ensure the old blog links continued to work. The old paths used the /blog/year/month/day/slug
format that made sense when I started with Hugo. Today I no longer feel I will have enough content to necessitate the longer path to my posts so I simplified it to /blog/slug
and set up some 301s in Nginx to keep the old routes functional. I also had to set up a couple other route rules on Nginx, but nothing major.
Sitemap and RSS feeds
To keep the Google Bot happy I had to make sure that I was generating a sitemap.xml
file in my Next.js project as it did not come by default, and I still need to decide if I want to keep an RSS feed. Many years ago I never would have thought about not having an RSS feed, but sadly I’m not sure many people use RSS anymore these days.
Conclusion
Overall I am very happy with Next.js for my blog. The content is in markdown, and the rest of the functionality is pretty easy for me to understand, maintain, and customize - something that I now put a premium on.
Hopefully, after reading this post, you will give your own blog tech stack some thought. You do not need the same projects as me, but I do encourage you to use something that makes sense to you. If what makes sense to you ever changes, do not be afraid to change your tooling too.