

A small tool only I can open
I had more than 200 cover drafts to choose from, so I built a page to pick them. It's a Vite plugin that only runs in development, uses the same code as my commands, and turns away requests from other sites.
12 posts with this tag.


I had more than 200 cover drafts to choose from, so I built a page to pick them. It's a Vite plugin that only runs in development, uses the same code as my commands, and turns away requests from other sites.


After moving my posts to mdsvex, Lighthouse said every post got heavier: 13 to 26 kB gzipped on a first visit. Two lines of mine were to blame: a glob of every post, sent to every post, and one small import that brought a YAML parser along.


My name, tagline, hiring texts and profile links were spread over the code and the message files. Now they're one YAML file the CMS edits, and the browser gets them as plain JSON: a nine-line Vite plugin parses the file at build time.


My Awesome lists each have a Lucide icon, chosen by name. Typing names from a website is no way to pick an icon, so the CMS got a field of its own, a Svelte component inside a React app, with the icon names read from the package at build time.


My CMS only ran in development. Now it's built into the live site at /admin, as a second Vite build, and GitHub sign-in goes through a small Cloudflare Worker that keeps the one secret a static site can't.


Importing Sveltia CMS from npm instead of serving its files made my setup half the size. On the way: a deadlock with no error, a bundler that lost the fonts, and a React effect that returned the wrong thing.


My CMS showed a preview of something that wasn't my site. Four tries later, it draws the post with the same Svelte components as the page, in the browser, as I type.


Where to keep a blog's images, why  breaks on a prerendered site, and a small Vite plugin step that turns it into optimized, checked images.


Where to compute a post's reading time in SvelteKit, and why the answer is "where the text already is".


Why filtering out draft posts wasn't enough on a static SvelteKit blog, and how a dev-only glob keeps every draft out of the build.


Turning a folder of markdown files into prerendered SvelteKit pages with mdsvex, why the usual preprocess setup broke on my own posts, and how Vite really orders plugins.


How I set up Open Props with postcss-jit-props in a SvelteKit 3 project. The config goes in vite.config.ts, and I explain why CSS needs a plugin to do tree-shaking.