Why This Blog Runs on Onttle
I got tired of managing MDX files in a repo. Here is why this blog keeps its posts in a headless CMS instead.
The problem with files
For years my blog lived in a content/ folder full of MDX files. It worked, but every typo fix was a commit, a push and a redeploy. Writing from a phone was out of the question.
What I wanted
- An editing screen I do not have to build
- A REST API I can call from Next.js
- Drafts that stay out of the public site
What this example does
Posts live in an Onttle table called posts. The Next.js app reads them through the REST API and caches the result. When a post changes, a webhook can tell the site to refresh.
What it does not do
There are no comments, no login and no view counter. This is a small example, and I would rather keep it readable than complete.