Blog Writing Workflow
The Process
Notion
I use Notion to hold all of my writing. It’s cross platform which means that I can edit on my computer or phone.
I keep all of the posts in one Notion database which is basically a spreadsheet. For each post, there’s additional metadata that helps me track whether or not the post hasn’t been worked on, is in progress, is ready to publish, or has been published to the blog already.
11ty (Eleventy)
As I’ve mentioned before, I’m using 11ty as my static site generator of choice. It’s not as simple as just editing HTML files, but I like to turn everything into a programming problem and I have more control this way.
The writing from Notion gets turned into markdown files and put into the 11ty repository which is stored on GitHub.
I would say that the project repository is the “canonical” database of all of the published writing.
Notion is really just the tool that I use to write and I don’t want to also give it the job of being a full record my writing. The repository has to exist no matter what, so the markdown files that exist on it are that record for published things. Having git version control for those files is a bonus.
This is an alternative to letting the Notion database be the “source of truth” and just have the 11ty repository pull from that every time it builds the website. However, I don’t want to lock myself into using Notion too much.
Notion may cease to exist in the future (or perhaps I stop using it because of its AI integration), but the repository is just files on my computer. Even if 11ty doesn’t work anymore, I still have the markdown files which are just text.
If I needed to jump ship and stop using Notion, moving WIP stuff might be a hassle for a little, but I can move to a new system without worrying about losing information.
11ty takes those files and turns them into HTML files which are displayable on the web. I have templates for how the website should look like and it basically pastes the writing into the right templates so everything (hopefully) looks consistent across posts.
I don’t worry about storing the built website because I could just rebuild it again from the source.
Neocities
I use Neocities’ terminal tools to publish the built website. This is the easiest part.
Automation
Of course, this is too many steps, so I automated the process so that I can do it at the click of a button.
In the Notion database, I have a checkbox called “Auto Process”.
Using Notion’s API, I created a script (in JavaScript, just like 11ty) that fetches the posts with “Auto Process” enabled, converts them into markdown files, and places it into the repository.
Using GitHub Actions, I created a workflow that does the whole process.
- It uses that script that I mentioned above to fetch all of the new posts.
- It commits those changes to the repository
- It builds the website using 11ty
- It publishes the built version to Neocities
The workflow itself is run by me clicking on a button on GitHub.
Because I glued all of these things together myself, there could be some horrible bug or something. Luckily I have version control.
In fact, this post is the first “real” time that I’m testing this process starting from writing and ending with a post on the blog. Here’s hoping it goes well.