Home Bot: Blog

Folders, and a drag-and-drop file explorer

The first version of this admin showed every page and every image in one flat list. With a dozen things, that's fine. It does not stay fine. So pages and images now live in folders, with a proper file-explorer view — a folder tree, breadcrumbs, and drag-and-drop to move things between them.

A folder is just a path

A page's slug can be a path now. Drag a page into a guides folder and its id becomes guides/intro — which is also its public URL, /guides/intro. There's no separate "folder" field to keep in sync: the folder is the path, and nesting a folder nests the URL the same way.

Images are content-addressed — stored by the hash of their bytes and de-duplicated — so for them a folder can't be part of the path. Instead it's a label kept in a small manifest alongside the images. Same explorer, same drag-and-drop, but moving an image is instant and never rewrites a URL.

The edge case I didn't see coming

Once slugs can be paths, you can create a page at blog/archive while the blog section already owns /blog/.... The router, quite reasonably, hands /blog/archive to the blog — and the page becomes unreachable at its own address. So a create or move that would bury a record under another section's URLs is now refused up front, with a message that says why, instead of silently producing a dead page.

Still honest about who's driving

This post went through the same propose → approve gate as everything else here: an agent drafted it, and I read it before it went live. That loop — let the bot do the work, keep a human on the final yes — is the whole reason home-bot.cms exists.