· 3 min read

Each cover's details, next to its post

The picker doesn't need its own folder any more. Everything worth keeping is now in content/, and Git has it. Drafts are temporary, and choosing a cover…

What we did

  • The picker doesn't need its own folder any more. Everything worth keeping is now in content/, and Git has it. Drafts are temporary, and choosing a cover deletes its post's drafts.
  • Each post has a cover.yaml: the titles and scene, the exact prompt, the seed and settings, the model's credits, and two review marks, one for the picture and one for the alt text. It isn't shown on the site.
  • content/covers.yaml lists only the posts waiting for a cover, with their scenes. Choosing a cover takes its post off the list.
  • cover-original.webp is the draft I chose, with every pixel kept. pnpm covers remake uses it to make the cover and masks again without Krea. It's never published.
  • The picker filters by what's left to do: covers to make, drafts to choose from, pictures and alt text to review, and covers made with an older style.
  • An Admin menu, only in dev, links to the CMS and the picker.
  • I moved the 69 covers I'd chosen, and the 15 posts still waiting for one.

What I learned

  • Everything in a post's frontmatter reaches the public JavaScript, even if no page shows it. I found a post's alt text in its JavaScript file. A separate file that nothing imports doesn't get there.
  • A post's "updated" date follows commits to its .md file, so a review mark in its frontmatter would have made the post look updated. cover.yaml doesn't change the date.
  • SwarmUI writes the prompt, seed, model and settings inside each PNG. Today's settings would give a different prompt for two of the 69 covers, because the style changed after I made them.
  • A lossless WebP has the same pixels as the PNG. The 69 originals take up 61 MB, about 40% less than as PNGs.

Problems & fixes

  • The site looks for every image next to a post, so it would have published the originals. Now it skips them, and a test checks that it still does.
  • If rejecting a draft removed every trace of it, "next free seed" could make the same image again. Each rejected draft now leaves a small file with its seed behind, until its post has a cover.
  • The Admin menu didn't show in the build, but its code was still in the public JavaScript. With dev from $app/env, the bundler can't tell that it's always false. With import.meta.env.DEV, it can, and it removes the code.
  • Two quick changes to the list could have overwritten each other. The picker now makes them one at a time.

Next

  • Make the covers that are still on the list, and review the alt texts.