a tool for shared writing and social publishing

Let publications move on and off Leaflet by record #102

targeting main from hipstersmoothie.com/leaflet:standard-site-import-export
Open opened by and assigned to hipstersmoothie.com
targeting main from hipstersmoothie.com/leaflet:standard-site-import-export

A site.standard publication changes platform by editing its own record — the url names the host that serves it. Two things broke when a publication arrived from, or left for, another platform.

Importing: a record already pointing at <name>.leaflet.pub had nowhere to register that subdomain. addDomain refuses leaflet.pub to everyone but four hardcoded staff emails, and createPublication only registers a subdomain for a record it is creating itself. The publication indexed and appeared in the dashboard, but its address resolved to nothing.

claimPublicationSubdomain does what createPublication already does at the end — Vercel project domain, custom_domains, publication_domains — for a publication that exists. It reads the subdomain off the caller's own publication record rather than taking it as input, so it can't be used to reserve arbitrary leaflet.pub names, and it's idempotent against a domain half-registered by an earlier attempt. The publication's domain settings surface it as a "set up" row.

Exporting: isLeafletPublication inferred ownership from the theme. An absent theme now no longer reads as "made here": ownership follows the record's url, which is what the middleware routes on and what an author edits to move. Publications on an author's own domain still count, via the domains registered against them here.

Covers both record formats — site.standard's url and pub.leaflet's base_path — and leaves legacy records without either untouched.

Commits 0