One of my best personal decisions of the pandemic-driven 2020 was to finally migrate my old blog from Sliwinski.com to this. To Michael.team. And not only because I have a new, shorter domain, but mostly because it’s a different technology stack and I can completely control it. I wrote about the transition here. As in Nozbe I hire brilliant programmers, I don’t code the app anymore. But I still like using programming languages to build something out of nothing and for this purpose, this blog is my place to do that.Last weekend I decided to get back to coding and built some long-overdue features like “next post”, “previous post” and “related posts”. It was so much fun! Read on, if you’re a programming geek like me:
Embracing the limitations of GitHub Pages and Jekyll
First off, my new blog is hosted on GitHub Pages and I didn’t want to change that. I didn’t want to have to manage additional server infrastructure. This means I have to embrace the only blogging engine they offer, which is Jekyll and only few of the built-in plugins of that platform.
I’ve included a simple post.js script in the layout of each blog post on my blog (including this one!) and what it does is this:
1) It runs once asynchronously in the background to check the list of blog posts in JSON and finds out which blog post we’re on and which are the previous and next ones. In the same time it sends another asynchronous request to check the same file for three most recent related blog posts (the ones with the same tag) and fetches them as well.
2) Once fetched, it displays the previous / next blog posts below the blog entry as well as the related section with the up to three related blog posts.
It works across all the languages I support, above I pasted a screenshot from the English “vaccine” article and below you can see a screenshot from the Polish „Piąteczek” article about our Mighty Fridays.
Programming is my happy place!
Day to day I’m a CEO and a leader of a software company and a writer. Programming from time to time gives me these additional mental challenges which are fun but aren’t required to meet any strategic goals.
Programming brings me joy.