Ian Monroe
All posts
I've integrated the Sveltia CMS to this site to make it easier to publish more often

I've integrated the Sveltia CMS to this site to make it easier to publish more often

sveltiaastro

When I moved this site off WordPress, I gave up one thing I actually liked: logging in from anywhere and just writing. The new site is faster, cheaper, and far easier to reason about. Every post is a Markdown file in a Git repo. The catch is that publishing meant opening a code editor, naming a file correctly, and pushing a commit. That’s fine at my desk. It’s a lot less fun from a laptop on the couch.

So I added a CMS. Sort of.

A CMS that isn’t really there

The tool is Sveltia CMS, a modern take on the old Netlify CMS (now Decap) idea. What makes it interesting is everything it doesn’t need:

  • No database. My posts stay exactly where they were, as Markdown files in Git.
  • No server. It’s a single static page at /admin/ that runs entirely in the browser and talks straight to the GitHub API.
  • No new hosting. The site still deploys the same way it always has.

The whole integration is two files: an HTML page that loads one script, and a YAML file that describes my content. That’s it. The site itself didn’t change at all.

How publishing works now

When I save a post, the CMS opens a draft pull request on GitHub. I can come back to it, tweak it, and leave it sitting there as long as I want. When I hit Publish, the CMS merges that pull request, my server notices the change, and the site rebuilds itself about a minute later.

That’s the part I like most. I get a friendly editor, but under the hood every post is still a commit with a full history. If I ever want to leave Sveltia, there’s nothing to migrate. The content was never locked inside it.

A few details I’m happy with

  • Images get optimized automatically. Uploads are converted to WebP and resized on the way in, so I don’t have to run them through a separate tool first.
  • Filenames take care of themselves. New posts get the date-and-slug filename my site expects, built from the post’s date.
  • The old stuff survives. My migrated WordPress posts carry some extra bookkeeping data. I tested that editing one in the CMS leaves all of it intact.
  • Video posts are protected. Posts with embedded video use a slightly different format, so the CMS gives them a plain text editor instead of the rich one. That keeps it from “helpfully” mangling the embed code.

The test

The real test is this post. I wrote it in the new editor, saved it as a draft, and published it from the browser. If you’re reading it, everything worked.

If you’re not reading it, well, you’re not reading this sentence either, so I guess we’ll never know.