

Don't describe the layout, draw it
My AI-generated covers wouldn't fit my blog cards, however I worded the prompt. Giving the model a blurry sketch to start from fixed the titles without changing the style.
Longer articles about what I learn building this site.


My AI-generated covers wouldn't fit my blog cards, however I worded the prompt. Giving the model a blurry sketch to start from fixed the titles without changing the style.


Writing alt text in two languages was the slowest part of making my covers. The image model's text encoder could already do it on my PC, as long as I check every answer.


My cover tool kept its data in a hidden folder that Git ignored. Now each AI-generated cover has its prompt, credits and original next to it, and none of them are published.


My first AI covers looked like toys and said very little. How I went from five styles to one, with a calmer background, machines that explain the post, and titles you can read on a small card.


My site has seven colour themes, but a cover is one image. An AI model paints the light in two colours I never show, a script turns them into masks, and CSS recolours it to match the theme.


24 of my posts had no cover, so I spent a day testing Krea 2 on my own PC. What each prompt change and LoRA did, where the memory went, and the two components I built to compare the images.


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.


A code block in my posts can now run: the page shows what the code makes above the code itself. In the CMS, where my GitHub token lives, the same demo runs in a sandboxed frame that can't reach it.


Since my posts are Svelte components, they can hold components too. I write them as directives: a colon, a name and some brackets, no HTML. Keycaps, a section you open, two things side by side, steps, tabs and a table of contents, each one a few lines of Svelte and drawn in the site's own look.


My code blocks used to carry a style attribute on every word, written by Shiki from a theme file. Now twinkleplop gives each token a class and the site's CSS colours it. I compared the two builds character by character before keeping it.


Two weeks after leaving mdsvex for svelte-markdown, mdsvex 1.0 came out and I moved back. I only switched once every blog and Devlog page, in both languages, matched the old build block by block. Here's what changed, and the two things a compiled post forced me to rethink.


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.


Once my posts became Svelte components, the CMS preview had nothing to mount until the post was compiled. So it compiles it, in the browser, the way the build does: mdsvex, then Svelte's compiler, then a module whose imports point at the CMS's own copies. All 72 posts preview exactly as the site shows them.


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.


Three scroll-driven animations on my Devlog timeline, no JavaScript: a line that fills as the middle of the screen passes it, entries that wipe in, dots that pop. And the one inset trick that makes the line follow your reading.


Full screen on a big monitor, my pages were a narrow strip. Wider pages, a reading column that keeps 80 characters a line but grows, a text size control that's restored before the first paint, and one font fewer.


Search on a static site with no server, in two languages, from a button in the header. Then the animations, and the trap of morphing a search result into a page while the search box is still on screen.


My 404 page now picks one of four toys at random, Breakout, Snake, an ASCII wave and loose dots, all made of the 404 itself. How it works on GitHub Pages, and why the game rules have no canvas in them.


My build job could push to main, and it runs code from hundreds of packages. Splitting the one job that writes from the ones that build, pinning actions to commits, and a faster smoke test on the runner's own Chrome.


My light theme was the dark one with the lights on. The first fix was too loud; comparing three directions with screenshots found the right one, ink green on warm white, and a test makes sure the grid never takes text below 4.5:1.


My footer now opens a panel about me and how to hire me, with a top card that changes look every time: a terminal, a spotlight, a business card, an open-to-work card and an ID card in 3D. How each one works, and how to keep five effects calm.


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.


I replaced mdsvex with svelte-markdown. Posts are rendered on the server by my own components, the CMS preview mounts the same ones, and every page got lighter.


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.


My site has a new toolbox, with ideas picked from several open-source collections. Before borrowing anything I read their licences, and ended up removing a credit line I had just added.


My site's background is a blueprint grid that lights up around the mouse. It looked great and read badly. How I found every piece of text sitting on it, and the one rule that fixed them all.


Characters, code points and bytes are three different things. How UTF-8 turns one into the other, why "ñ" sometimes shows up as "ñ", and what it means for HTML, CSS and JavaScript.


btoa('ñ') gives the wrong answer and btoa('😀') throws. Base64 works on bytes, so text has to become bytes first. How my Base64 tool does it, and how it tells bad input from binary data.


I added Sveltia CMS to my site's dev server. Its first save rewrote lines I never touched, so I gave it my own file format and a test that saves every file and compares the bytes.


Each post's Spanish version is a second file in its folder, with only the words in its frontmatter. How the site reads it, and what a Spanish page shows until it exists.


Click a post card and its title, picture, date and tags fly into their places on the post. How view-transition-name pairs two elements across a navigation, and the four things that made it look right.


My blog page opened with a wall of 55 tag links. Now it's a sidebar of coloured chips, most used first, that fades out into a button, and what fades out is really gone for the keyboard too.


My site is in English and Spanish now, with a SvelteKit hook, two files of messages and one rule about links. What Paraglide would have done, and what I learned doing it myself.


A code block whose language is a component name, with YAML inside, becomes that component on my site. Everywhere else it's a readable block of YAML. And the build checks every field.


My site now has six colour themes, from Tokyo Night to Solarized. Each is one CSS file, no component changed, and a unit test checks every theme's contrast.


GitHub and Obsidian both draw "> [!note]" as a callout box. A small rehype plugin makes my site draw it too, and it's still a plain blockquote anywhere else.


Short screen recordings next to a post: why not a GIF, how the build finds the files, and the attributes that keep a video from jumping or autoplaying.


Three of my pages scored under 90 in Lighthouse for one reason, content moving after it appears. Two causes, web fonts and content added by JavaScript, and how I fixed each.


Two rehype plugins give every heading in my posts an id and a link to itself. Why I wrap the heading instead of adding a "#" link, and how SvelteKit fails the build on a broken one.


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.


I assumed every deploy renamed every file and made visitors download everything again. I built twice and read the headers: half right, for a different reason.


How one cover.png next to a post becomes a card thumbnail, the post's hero, and its link preview, with the right sizes, the right alt text and one clickable card.


My build processes every image again on every run. How actions/cache keeps work between runs: where it's stored, when it disappears, which branches can see it, and a key that only redoes new images.


One Playwright test that clicks every link in my site's nav, and why it checks for errors a build can't see.


I'd never written a test. Adding Vitest to my SvelteKit site, testing three small functions, and the edge case that turned out to be a real bug.


My robots.txt was blocking every crawler, or so I thought. On a project site it's never read. What actually controls indexing there, plus one Seo component, absolute URLs while prerendering, and a sitemap from my content.


My background grid lights up around the mouse. Where it ran under text, the text dropped to 1.89:1. How I measured a translucent layer, and how I picked the strongest effect that still passes.


A breadcrumb trail from data the routes already have, and the bug I found on the way. My nav's current-page marker was never in the prerendered HTML, because resolve() writes relative links while prerendering.


A collapsible section that works without JS, opens by itself as you scroll, respects what you chose, and doesn't hide its content from find in page.


My CV builder lets me edit the skills for each job profile. Saving my changes to the list, instead of a copy of it, kept the site's data in charge, and one ??= taught me about Svelte's proxies.


One line of CSS made every page change in my SvelteKit site glide up from wherever the last page was scrolled. The fix is a data attribute and two navigation hooks.


My about page now filters skills by the kind of job I'm applying for. One choice at a time means radio buttons, and :has() lets me style them without giving up what the browser does for free.


My CV builder makes its PDF with the browser's own print dialog. A print stylesheet, the light theme on paper, and a page title that becomes the file name.


My skills moved from TypeScript to a YAML file. The icons came along as data, the icon libraries stopped shipping to the browser, and the page lost half its weight.


The effects on my about page, and the bugs behind each one. An animation that never animated, an observer that never saw, and 168 KB of duplicate SVG.


The browser already knows when a field is required, isn't an email or doesn't match a pattern. I only had to decide when to say so, and in which words.


Every logo on my about page keeps its brand's hue but takes its lightness from the theme, with a little OKLab math and CSS relative colors.


Give several <details> elements the same name, and opening one closes the others. My CV builder's form folds away with it, with one catch about focus.


My CV builder keeps what I type in the browser, never on a server. One $state object, an $effect to save it, and a select that taught me events don't always arrive in the order I think.


One prerendered page per tag, a list of tags built from the posts, and a build that fails on a bad tag.


Highlighting code blocks at build time with Shiki, and a small TextMate theme whose colors are CSS variables, so code follows my site's themes.


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


My site lives under /portfolio on GitHub Pages, so a markdown link to /about broke. An mdsvex layout swaps every link for a component that fixes it.


A $state class for an Awesome list's filters, $derived results, and a URL you can share, on a page that's prerendered.


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.


Reading CSS custom properties in the browser, turning any CSS color into sRGB with a canvas, and the light-dark() surprise along the way.


Wrapping long lines, numbering them with a CSS counter and adding a copy button that only shows up when it works, around Shiki's HTML.


Where to learn how Svelte styles components, from the official tutorial to videos, plus the playground experiments that finally made scoped styles click for me.


What the Svelte compiler does to a component's style block, why a page's styles couldn't reach my rendered markdown, and when :global() or a global class is the right fix.


My home page keeps the intro in view while the sections scroll past, and a small nav shows which section you're reading. position sticky, a few lines of measuring on scroll, and proximity snapping that only applies to one page.


Animations that follow the scroll instead of the clock, in pure CSS. A header that lifts into a floating bar, a footer that slides in, and a hint that there's more below, all with a fallback for older browsers and reduced motion.


View transitions between routes with onNavigate, a nav marker that slides to the new page, and a typed way for each route to tell the root layout how to arrange it.


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.


I replaced Open Props' grays with my own blue-gray scale in oklch, picked a terminal green, and designed the dark theme first. Why oklch makes a scale even, and what "dark first" means in light-dark().


A graph-paper background made of four gradients, plus marks drawn with a mask, and a spotlight that lights up the grid around your mouse. One fixed layer, no images, and it follows the theme.


My theme toggle became a sun that turns into a moon, and the new theme now grows out of the button in a circle. An SVG mask, one number token, and the View Transition API.


How I typed my hero component's props, made links that can't point to a missing page, and handled empty lists, with a few TypeScript tricks along the way.


Fira Code for code, a handwritten font for my dev log and the system font everywhere else. No Google Fonts, no extra cost on pages that don't use them.


Card grids that pick their own column count, a hero that adapts to its container instead of the screen, and a header that rearranges itself with grid areas.


Why my hero component doesn't animate itself, how the page passes it animations as CSS props, and a reduced-motion safety net that actually covers delays.


My hero photo in AVIF, WebP and JPEG at two densities, with no layout shift, from a single import.


Dark mode for my SvelteKit portfolio. Theme colors live in tokens.css using color-scheme and light-dark(), and a toggle overrides the OS setting.


How @layer lets me decide once which global styles win, and why my Svelte component styles beat all of them without extra effort.


Why my components use --text-1 instead of --gray-8, and how a small tokens.css made dark mode a one-file change.


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.


My GitHub Actions setup for a solo SvelteKit 3 project. PRs run checks, merges to main deploy, and an artifact connects the two jobs.