Preview a draft and publish it safely

4 min read · Updated 2026-09-12

Short answer

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

  1. 01Save writes a draft. Publish is a separate, deliberate step.
  2. 02Preview routes render the draft so you can check it before anyone else can.
  3. 03The page slug home maps to the site root.
  4. 04Publishing content is not the same as deploying your application.

Steps

  1. 01

    Save 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.

  2. 02

    Open 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.

    tsx
    // src/app/preview/[pageId]/page.tsx
    import { notFound } from "next/navigation";
    import { RenderedPage } from "pagiera/runtime";
    import {
      getPagieraServer,
      pagieraConfigFromEnv,
    } from "pagiera/server";

    Preview routes show unpublished work. Protect them the same way you protect the editor.

  3. 03

    Publish

    Publishing promotes the approved draft to the public page and refreshes the Redis-backed published cache. The public route then serves the new revision.

  4. 04

    Render the published page

    Published documents are loaded on the server so Request blocks finish before HTML is returned.

    tsx
    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.

Questions

  1. 01Next.js setupAdd a visual page editor to a Next.js application
  2. 02Pagiera as a CMSUse Pagiera as a self-hosted CMS for a Next.js site

Say hi to Pagiera and build your first page

Install the package and have the studio running in minutes.

bun add pagiera