Preview a draft and publish it safely
Does saving a page in Pagiera make it public?
No. Saving updates the draft only. You preview the draft on a preview route, and the page becomes public only when you publish it. The home slug maps to /. Publishing updates the page content — it does not deploy your host application or configure a domain.
Key points
- Save writes a draft. Publish is a separate, deliberate step.
- Preview routes render the draft so you can check it before anyone else can.
- The page slug home maps to the site root.
- Publishing content is not the same as deploying your application.
1Save the draft
Saving stores the document revision in PostgreSQL. Nothing on the public site changes at this point, which means an unfinished layout can sit in the editor for as long as it needs to.
2Open the preview route
A preview route renders the draft document through the same runtime the published page uses, so what you approve is what will ship.
// src/app/preview/[pageId]/page.tsx
import { notFound } from "next/navigation";
import { RenderedPage } from "pagiera/runtime";
import {
getPagieraServer,
pagieraConfigFromEnv,
} from "pagiera/server";NotePreview routes show unpublished work. Protect them the same way you protect the editor.
3Publish
Publishing promotes the approved draft to the public page and refreshes the Redis-backed published cache. The public route then serves the new revision.
4Render the published page
Published documents are loaded on the server so Request blocks finish before HTML is returned.
const server = await getPagieraServer(pagieraConfigFromEnv());
const page = await server.getPublishedPage(slug, {
query,
params,
page: { slug },
});
if (!page) notFound();What publishing does not do
- It does not deploy your host application — your own pipeline still owns that.
- It does not configure DNS or a domain.
- It does not change your authentication or infrastructure.
Frequently asked questions
Does saving a page make it public?
No. Saving updates the draft. You preview the draft and then publish to update the public page. The home slug maps to /.
Can I roll back a published page?
Pagiera keeps page documents and revisions in PostgreSQL, and the editor exposes a History tab. Check the behaviour of the version you installed before relying on a specific rollback flow.