3 ms·
Now I'm imagining a static site editing tool that runs the exact same templates client-side to power an accurate preview that are then used by the static page b
by simonw 7mo ago
Now I'm imagining a static site editing tool that runs the exact same templates client-side to power an accurate preview that are then used by the static page build process.
- nimonian 7mo agoI am building _exactly_ this for my org for the past month, using Nuxt Content. A "draft" is a row in a database with live preview. Users can click a button to make a checkpoint (git commit, by GitHub API, but they don't know that). When they click "publish", the PR for their draft is merged. Writers in my team can use a nice Tiptap editor with custom components. I get the change management of git. The API for reading content and editing drafts is also exposed over MCP meaning AI can collaborate in the authoring process from anywhere that can connect to MCP. Loving it so far.
- huijzer 7mo agoI’ve tried to build that but GitHub doesn’t allow secrets to be stored inside browser so you can’t commit.
- simonw 7mo agoGitHub's content API is available over CORS: https://tools.simonwillison.net/cors-fetch#method=PUT&url=https%3A%2F%2Fapi.github.com%2Frepos%2Fsimonw%2Fdatasette%2Fcontents%2FREADME.md&bodyType=json&json=%7B%22message%22%3A%22my+commit+message%22%2C%22committer%22%3A%7B%22name%22%3A%22Monalisa+Octocat%22%2C%22email%22%3A%22octocat%40github.com%22%7D%2C%22content%22%3A%22bXkgbmV3IGZpbGUgY29udGVudHM%3D%22%7D&headers=%5B%7B%22key%22%3A%22Accept%22%2C%22value%22%3A%22application%2Fvnd.github%2Bjson%22%7D%2C%7B%22key%22%3A%22Authorization%22%2C%22value%22%3A%22Bearer+%3CYOUR-TOKEN%3E%22%7D%2C%7B%22key%22%3A%22X-GitHub-Api-Version%22%2C%22value%22%3A%222026-03-10%22%7D%5D https://tools.simonwillison.net/cors-fetch#method=PUT&url=ht... I've built client-side apps that store a GitHub token in localStorage and send them with fetch() for creating Gists and that works fine: https://tools.simonwillison.net/terminal-to-html https://tools.simonwillison.net/terminal-to-html