In Search of a Better Writing Experience
I've written about my writing setup previously, so I won't go into details here. I've been running it for a couple of years now and have not written much at all! Part of it is because I was too lazy to write. But part of it was because the steps required for publishing a post were numerous and too cumbersome.
The Proof is in the Pudding #
The Gutenberg editing experience is great and I had no problem writing in it. I enjoyed writing using the local installation of WordPress. And the blog was fast, secure, and didn't cost any money to host. The result was something I could work with.
The problem was in the publishing process itself. Whenever I wanted to publish a new post:
- Boot up my PC, because that's where I had the instance hosted.
- Boot up the dev environment inside Docker.
- Write the actual post. And save it.
- Generate the static site. This took a while with the plugin I was using.
- Push the static content to GitHub so the new site is deployed by Netlify.
Other than steps #3 and #5, everything was sub-optimal and added pain points to my flow.
These pain points eventually build up to the point where I just don't even bother posting. In addition to these issues, I also had to deal with these flaws in my system.
- The Simply Static plugin I used kinda worked, but kinda didn't. I think it's meant to be used alongside a live WordPress distribution rather than instead of it. Some of the features I missed were things like automatic feed generation and search. It also created a lot of files since it was purely static, but I think I need something that's one level above pure static file generation.
- Because I was running Wordpress locally, I also needed to provide a database for Wordpress. The problem with a local data store is, you tend to lose all your data when your non-replicated HDD crashes. Restoring was a painful process since I had to restore using my static pages.
So, all in all, not fun.
A Better Way #
Since I'm in a state of transition right now (moving countries, more on that later), I thought this was a good time to play around with this setup. After tinkering for a while, I came up with a Rube Goldberg machine-like process to make writing painless.
- Convert my blog to 11ty
- The content is still hosted on GitHub
- I write my post using markdown on a web app or offline
- I email the post to a special email address that is setup for receiving emails on AWS SES
- AWS SES takes the email content and dumps it in an S3 bucket
- A lambda function is configured to listen to create events on the S3 bucket
- On trigger, the lambda function clones the repo, downloads any linked images, and creates a new folder structure with the post and images
- The post is then updated to point to the local versions of the image and then the post is committed to github
- The commit triggers a build in Netlify
- The build is done by 11ty and generates a fully functional static site
- Netlify deploys the new version of the build
While this setup is a little more complicated than the previous setup, that complication is upfront and one-time. Once I have it in place, then the process of posting becomes as simple as sending an email.
It also decouples the act of writing the post from the publishing of it. This means I can write anywhere I want and I can keep iterating on that till I find something that works for me. But none of the other steps would need to change, so I have fewer points that cause friction. How do I know this? Because I've already got most of it working:
- The website has already been converted to 11ty and I have all the markdown files.
- The lambda function is running and deploying to GitHub.
- The SES email is configured and triggerring the correct events.
- I just need to clean up the lambda code.
As part of the process, I'll write about each component and detail the steps I took. If you're reading this post, then I've already got the process working and things should (hopefully) be running smoothly.
Check back soon to read the next part in the series!