· 5 min read · updated

Keep the recipe with the picture

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.

Printing machine

When I'd finished choosing most of my covers in my cover picker, I asked a simple question: what do I do with its folder now? It had 434 MB of drafts, a list of posts to try again, and a file that recorded which draft each cover came from. Git ignored all of it, so the only record of how my covers were made was on one computer.

I didn't want to look after a second folder. My posts already have one, and Git looks after it. So now the tool works out what it needs from there.

Three kinds of file

Most of the work was deciding how long each thing had to last:

  • The covers I've finished need to keep their details for as long as the cover exists. Those go next to the post, in cover.yaml.
  • The covers I still have to make need a scene and maybe a reason. They're all in one list, content/covers.yaml. When I choose a cover, its post leaves the list and the scene moves to its cover.yaml.
  • Drafts only matter until I choose one. They go in node_modules/.cache/, and choosing a cover deletes its post's drafts.

A cover's details look like this:

yaml
top: DESIGN TOKENS
bottom: NAMES, NOT COLOURS
scene: >-
  The machine is a labelling machine, with its parts read from left to right…
reviewed:
  picture: true
  alt: false
made:
  date: 2026-11-30
  seed: 6001
  steps: 8
  prompt: >-
    A highly detailed, realistic isometric 3D render of precise miniature hardware…
credits:
  model:
    name: Krea 2 Turbo
    by: Krea
    licence: Krea 2 Community
  app: SwarmUI 0.9.8.4

I've left out a few lines, like the image size and the model file's hash. The tool doesn't need to save a status. If a post has no cover.yaml, or it's on the list, it needs a cover. If alt is false, its alt text needs a review. A status that's worked out can't get out of step with the files.

Why not frontmatter?

My first idea was to put all this in each post's frontmatter. No page would show it, so I thought readers would never get it. Before building it, I searched my site's build for one post's alt text. It was in the page, as it should be, but it was also in the post's JavaScript, with the rest of its frontmatter.

That's because mdsvex turns each post into a component and exports its frontmatter as metadata. A 3 KB prompt that nobody sees would have been sent to everyone who opened the post.

There was another problem. My posts show when they were last updated, based on the latest commit to their .md file. Marking a cover as reviewed would have made the post look updated. A separate file that nothing imports solves both problems.

That doesn't make it secret. My repo is public, so anyone can read it there. It just isn't part of the site.

Save what happened, not today's settings

A prompt is made from the post's scene and a style that all my covers share. I could have saved only the scene and built the rest again later, but the style changes. When I compared them, today's settings gave a different prompt for two of my 69 covers.

I didn't have to guess what the real prompts were. SwarmUI, the app I make images with, saves the prompt, seed, model and settings inside every PNG. I read them with sharp:

ts
const { comments = [] } = await sharp(draft).metadata();
const text = comments.find(({ keyword }) => keyword === 'parameters')?.text;

Each cover keeps both: the scene, so I can edit it, and the exact prompt, so I know what the model was given. If today's settings would give a different prompt, the picker tells me the cover uses an older style.

The credits work the same way. If a draft was made with a model my credits don't cover, or with an extra LoRA, the tool won't let me use it. That's better than quietly crediting the wrong thing.

Keep the original, but don't publish it

My covers change colour with the site's theme, using masks made from the original magenta and lime image. If I ever change how the masks are made, I'll need that image again, and the same seed might not give me exactly the same picture. So I keep the draft I chose.

A lossless WebP keeps every pixel of the PNG but takes up less space. My 69 originals are 61 MB, about 40% less than as PNGs. Git keeps every version of an image, so each time I replace a cover, the repo grows a little more.

There was one more trap. My site looks for every image next to a post, and each file that search finds goes into the build, even if no page uses it. Without a change, I would have published all 61 MB. Now the search skips the originals, and a test checks that it still does.

Check before you delete

Before deleting the old folder, I wanted to be sure I could do without it. Just copying the files wouldn't prove that. For all 69 covers, a script compared every pixel of the new original with the old PNG, and every saved detail with what the PNG said. It then made each cover and its masks again from the new original, and compared them with the ones on my site, byte for byte. This only works because nothing is random after the image model.

If you use AI images on your site, keep more than the final picture. Keep the original, what made it and who to credit, all next to it. You'll want them when you need to change something, or when someone asks how you made it.