Published On Nov 23, 2023
Relevant resources :
The Notion template: https://affiliate.notion.so/my-notion...
My Next JS code (Work in progress !): https://github.com/Kodaps/gradient-as...
The Notion parse NPM module: https://www.npmjs.com/package/@kodaps...
The Notion Parse code: https://github.com/Kodaps/notion-parse
-------
I use Markdown to store the static content for my NextJS websites. There are many reasons why: it’s free, it’s open, it’s portable, it’s editable, and there is no buyer lock-in.
However, on my personal blog, I now have about 75 blog articles in both French and English. And it is becoming difficult to get that content correctly organised.
I’ve explained previously how I ensure that the data stored in the FrontMatter follows the right shape using an SDK called ContentLayer.
But is there a way to better organise it?
I want something trivial to set up. I want to be able to edit content on my phone when I’m commuting to work. I’ve tried different solutions, but I’ve settled on using Notion to track all my content.
If you don’t know Notion, it’s a free tool for organising your life. And it allows you to easily set up tables with custom fields. And that’s great for my content because each type of content has different fields. For example, I have a table for blog posts, one for pages, and one for newsletter issues (incidentally, I’ve provided a link in the description if you want to sign up).
The reason why Notion, Markdown and ContentLayer are a perfect fit for my use cases and my situation is because all three allow you to define your data schema in the content itself.
So, what happens when I want to update content? I run a script that downloads data from Notion and saves it as Markdown. I’ll explain how in a second.
So, how do we go about it? Well, allow me to walk you through the steps.
----
Want to go into further depth? Head to https://kodaps.dev/