Workspace Draft Editing

Workspace Draft Editing Contract

Last updated: 2026-05-27

This note aligns the shared generator editor with the workspace-app draft model.

Surfaces

  • Published sites are immutable release output.
  • Draft sites under *.drafts.quantalumin.com are the primary hosted editing surface.
  • Nextcloud External Sites may frame or link draft sites, but Nextcloud is the shell entrypoint, not the source of render authority.
  • Hugo remains the render authority. Browser editors write Markdown/config source through the configured provider.

Provider Rules

Hosted workspace editing should use the workspace provider backed by generator-api.

Site config should provide:

[params.qlMarkdownEditor]
generatorApiBase = "https://generator.example"
workspaceId = "..."
workspaceTargetId = "..."
refBibPath = "assets/bibliography.bib"

[params.qlMarkdownEditor.workspacePrincipal]
uid = "..."

The editor must stay hidden unless the page is on localhost or an authenticated session exists. Anonymous draft visitors must not receive general-purpose edit controls.

Draft Mode Behavior

In draft mode, replace-main remains the preferred editing presentation:

  1. open the Hugo-rendered page,
  2. resolve the current Markdown source path from page metadata/provider state,
  3. load source through generator-api,
  4. edit in Nowtype,
  5. save Markdown back through generator-api,
  6. refresh via SPA navigation when available.

The local bridge is still the local-development analogue of the hosted workspace provider. WebDAV remains a compatibility transport only.

Draft preview routes are workspace-protected, but content-authored page locks are shown as page status rather than enforced inside drafts. A page with draft: true gets a draft badge, and a page covered by pageLocks gets a lock badge. Production routes continue enforcing the generated lock manifest.

Ownership Boundary

Workspace-app owns workspace identity, route assignment, draft hostnames, SSH sandboxing, and storage exposure. Generator owns shared Hugo templates, runtime/editor assets, and the browser-side editing contract.