I use Markdown for most of my static sites. Editing a post still means switching between the browser preview and a text editor.
I wanted a shorter loop:
- Click the text on the page.
- Edit it in place.
- Save the change back to the
.mdfile.
The tools I found were too complex or required a different stack. I wanted something small that worked with my existing Astro site.
So I built inlineCMS, a development-only Astro integration built around contenteditable.
The editing loop is simple:
- It makes the rendered Markdown editable.
- It saves after a short pause or when the editor loses focus.
- It sends the edited HTML to the local dev server.
- The server uses Turndown to convert the HTML back to Markdown, keeps the frontmatter, and writes the source file.
- Astro sees the file change and refreshes the page.
This is not a production CMS. It only runs during development, which is exactly what I need. Setup stays small, and editing no longer breaks my flow.
The code is on GitHub. PRs are welcome.