I started blogging around the year 2017. My main inspiration was this post. The primary motivation was to document learnings for others and my own reference. One of the features that I like about blogs is tagging. Tags make it easier to search for prior related posts, and I wanted to do the same with my own notes (at least my notetaking app at the time didn’t have this feature).
So around 2017, I just jumped straight into it by provisioning WordPress from WordPress.org on Azure App Services. So many people were using WordPress, so it should be good, right? Yes, until I learned that there’s work to be done to secure WordPress. Unfortunately, I didn’t do any of that. And so the short story is that my site got defaced, which forced me to start afresh as I didn’t have any backup.
Learning from this, I decided to get a paid account from WordPress.com. WordPress SaaS (Software-as-a-Service) comes with the security layers and configurations that I was too lazy to learn and do myself. There’s even live chat support in case I need any additional help. And so this became my blogging platform from 2018 up till yesterday.
WordPress.com isn’t cheap though. Although my blogs are simple, given the technical nature of what I share I needed plugins for:
- sharing code
- displaying tables
Unfortunately, only Wordpress.com’s Business Plan allowed the installation of plugins. So yes, it cost me a lot of money to maintain this blog, \US $420/year to be exact.
The concept isn’t new so let me just describe it briefly. The idea is to write using markdowns and use Jekyll to generate a static site that is deployed publicly.
graph LR A[Blog posts written in markdown] --> B[Jekyll] B -- generates --> C[Static Site]
There are a lot of benefits in doing this
Cost: hosting static sites is very cheap. I decided to use Azure Static Web Apps. At least until this blog grows, I’m still well within the free limits (not that the standard tier is expensive). Azure Static Web Apps also made automation easy, as it conveniently created my CI/CD pipeline.
Security: because it’s a generated static site, there are no credentials to hack. And if anything happens, I could simply regenerate the site.
Markdowns!!!: this is one of my biggest motivations in making the switch. Markdowns allow me to focus on writing. I’m already writing a lot of
.mdfiles in my Git repos, so why not use the same format for my blogs?
- Supports code blocks, with identifiers.
- Supports tables
- Supports mermaid diagrams.
- Since it’s a text file, it can easily be stored and versioned in a Git Repo.
Markdowns are seriously good. It allows me to write things in plain text and reformat later, enabling me to let my thoughts free and prevent writer’s block. I am now also transitioning to write even my personal and work notes in markdown format, but that’s a post for another time…
Note that there are other alternatives to Jekyll, such as Hugo and Gatsby. After some quick research, I simply went for Jekyll because, at least according to other blogs, it is one of the easiest to set-up and learn. Since I just needed something straightforward, this seemed like the best technology to use for my purposes.
But what works for me may not be the best for you. So do your research and form your own opinion.
So that’s it! Now for me to share how I migrated from WordPress, in the spirit of learning and reference.
Quick disclaimer: I just kinda wiggled my way through this. As I write this now, I just found this recommendation from Jekyll, which I DIDN’T use. This method might have been better…
But here was my approach:
- From WordPress, I used these plugins: Jekyll Exporter and Export Media Library.
- Created a Jekyll site with a starter theme. There are lots of themes available.
- Copied my
.mdexports to the
- Copied my image exports to a new
- Edited every
.mdfile and fixed all the links to the pages and images. This was quite tedious.
- Modified every table and source code to the markdown way.
- Viewed the pages and resized some images for better readability.
- Installed this image carousel which was used in one of my oldest posts.
I’m still learning how to override the themes and have consistent styling across platforms. But at the time of this post, I decided to launch with the default theme. As I’m still going through the basics, here are the top 3 reference sites that I go to:
That’s it! Hope this helps someone :)