Content model
Page sections are only one part of a site. WiseWig stores page documents, site settings, navigation, media metadata, and forms as distinct schema-validated resources.
- Pages: a versioned collection with stable page ID, one-segment route slug, title, SEO description, optional bounded AI metadata, and typed page document. IDs/slugs are unique and exactly one page owns the empty home slug.
- Page documents: typed sections in stable layout slots. HTML is a rendering output, never the primary content model.
- Site settings: business identity, contact data, social links, and default SEO.
- Navigation: named trees of internal or external links, independent of page layout and edited by stable item ID.
- Redirects: validated same-site path mappings, versioned independently from page layout.
- Media metadata: object key, accessible title/alt text, filename, MIME type, byte size, usage references, and lifecycle state; R2 holds bytes only. The Cloudflare adapter streams approved images, MP4/WebM videos, and attachment-only PDF/text/CSV files to tenant/site-scoped R2 keys. External video embeds are separate typed references containing an approved provider, video ID, and title—never stored iframe HTML.
- Forms: field schema, consent/validation policy, success message, and approved notification targets.
Forms do not contain arbitrary execution code or email configuration supplied by an editor. Submission delivery is an adapter capability with spam protection, retention, retry, and audit policy.
Page AI metadata contains a concise semantic summary, intended audiences, topics, developer instructions, and a publicDiscovery decision. It is stored beside route/SEO metadata rather than inside rendered sections, so it can guide search, MCP resources, prompts, and editor assistance without becoming arbitrary page markup. Only metadata from a published, publicly discoverable page belongs in the public AI index; draft metadata remains private.
Before a submission is stored or delivered, validateFormSubmission() checks untrusted values against the published form definition. It rejects undeclared fields, missing required values, invalid email/checkbox types, and configured text limits. Submission data is private: it is never included in public page documents, public MCP tools, or public-rendering bindings.
See site resources for the navigation, settings, and redirect mutation rules.
The reference site ships Home, About, Services, Gallery, and Contact as one pages resource. The page lifecycle API creates schema-valid Basic, Services, Gallery, or Contact documents; duplicates content under new section/slot identities; edits route/SEO metadata; reorders pages; and deletes only with a valid replacement-page redirect. The empty-slug home page is neither renameable nor removable.
Every lifecycle mutation validates the resulting page collection, navigation tree, and redirect set. The Cloudflare adapter checks all three expected draft versions and writes all three resources in one Durable Object SQLite transaction. Publishing promotes the same bundle atomically. Renames update navigation and add an old-path redirect; deletion removes the navigation item, adds its redirect, and retargets redirects that pointed at the removed path. Published delivery invalidates both page paths and redirect sources. Private edit/preview query state is preserved across an internal redirect, while published redirects remain clean public paths.
Publishing indexes all page text and invalidates every published route. A legacy single-home document remains readable during migration; new scaffolds use the page collection.