MishkaDocument. Resources. Changes. EnsureAddressPages
(Mishka Document v0.0.1)
Copy Markdown
View Source
Gives a document the two pages its own address is read at, when the address is set — its front
page and every page of it (MishkaDocument.Provision.ensure_address!/3) — so an admin who writes
/product/docs on the form is answered there without building a page.
A page the site already has at either path is kept, its own design among them. The pages are written as the writer, in the same transaction as the document: a writer who may not write pages is refused before anything is saved, with what they are missing, unless the site already has both — a document with an address is read there and nowhere else, so an address that answers nothing leaves it unread. With no actor the system writes, as the seeds do.
Nothing happens when the address is not changing, or is emptied: a document read under /docs
again leaves the pages it had for the admin to keep or remove.
Usage
change MishkaDocument.Resources.Changes.EnsureAddressPages