My wife loves blogging. So I had created a WordPress instance for her where she could manage her blogs. For anyone who has used WordPress, you know that it is fairly intuitive and has a lot of features. However after a couple of years of hosting her blog on WordPress I decided to kill it and move it to a home-written blog site.
Reasons why WordPress sucks
WordPress maintenance is annoying:
I am not a WordPress developer or even a PHP developer. I am just a technology guy who knows enough to be dangerous with code. For anyone who has used WordPress, you know that WordPress gets updated fairly regularly. As much as this is great for security and features, if you are not regularly using WordPress and self-managing the updates it can be quite daunting to click that “Upgrade to version X” button. Now this problem can certainly be mitigated if the management is outsourced to the hosting company - but then you have to pay extra for that - not something I am willing to do.
Backing up WordPress might be easy but restoring it can be quite tricky. I remember a few years ago when I was making changes to a WordPress site and needed to take a backup - in case I wanted to restore it - it was quite a nightmare process. I don’t recall the exact issue now, but it took me a few days or weeks to get the restoration right. I had to learn some WordPress CLI for it - which by the way if you really want to be a WordPress expert is a must-learn.
WordPress is an over-kill if you simply want to write blogs. WordPress is probably fine for someone who has fairly complex needs - for instance blogs where you have multiple editors, or blogs that need plugins, or blogs that need custom forms etc. but for someone who just wants to write (as is the case with me and my wife) WordPress is not needed.
WordPress can be quite inefficient. When I was helping a non-profit to maintain their WordPress site, I quickly realized how bloated WordPress is. For the tech-savvy ones - if you turn on the browser traffic for an average WordPress site you will notice the amount of bloat that WordPress loads is just disgusting - multiple CSS files, multiple javascript files, multiple versions of the some javascript framework etc. Now most of this bloat is because people using WordPress just add and remove plugin and each addition could mean an extra css or js or both. One could argue that if you are “good” at WordPress this isn’t an issue - which is absolutely true - but I don’t always have the time to learn the complexities of WordPress.
Recent drama between WordPress and WPEngine has left me a bit concerned about their future. I know WordPress will likely survive anyway, and maybe WPEngine might just fork WordPress and go on with it but either way as a customer I don’t feel like I am in safe hands with the WordPress leadership or where it is headed.
What did I end up doing if not WordPress
My first thought was to have a pure HTML only site. However, I wanted to be sure that my wife could use it too. She is not as nerdy as I am when it comes to the code, but she is fairly good at following instructions. She could have written her blog in HTML but I wanted to still simplify the process for her. A markdown to website generator would be perfect for her, one can find a lot of projects on github that offer this. I read through a few of them, but again they either felt like overkill or too opinionated for my taste. In the end I decided to write my own markdown to html site generator. While doing this I realized I have reinvented the wheel - probably a few times - but it was fun and took me about 10-12 hours over a few days to finish it.
Here is how it works: (I am hoping to make this code public at some point)
To write a blog article, one has to simply create a new markdown file.
The name of the file is added to a configuration file where one can add some metadata for that blog page (Ex: date, tags etc.)
The markdown file can be edited in any editor. I prefer VS Code.
After the markdown file is saved, I wrote two simple bash scripts
- One that uses pandoc to convert all the markdown files using a bash loop followed by starting the PHP’s built-in server:
pandoc -f markdown -t html blog-name.md -o blog-name.html
php -S localhost:8111
- Another that pushes the code to git and then ssh into my host and perform a git pull of the files.
Principles I used to create the blogging site:
Classlight CSS : There are some amazing classless or class light CSS projects out there. I figured since I am using semantic HTML anyway why bother spending time on CSS. I ended up using Simple CSS. For those little CSS customizations that I needed, I just wrote my own css.
No Javascript : At the time of writing this blog, I have no javascripts whatsoever on this blog and I hope I can keep it that way for years to come.
Some PHP and HTML templates: There is one PHP file and my own HTML template format for re-using HTML tags (nav, header, footer etc.). I could have used Twig or some other templating engine but again it would be an overkill for what I wanted to achieve. So at the expense of slightly re-inventing the wheel I was able to accomplish this fairly quickly.
Efficient hosting : I am using nearlyfreespeech.net. They are very easy to use, offer PHP support, extremely reasonable pricing and both SSH and FTP options. I would highly recommend them. As a side note, you can also host WordPress on them, they offer MYSQL too.