draft: true) also show in previews, so reviewers can read a post before it goes live.
Local development
With Node.js 22.12 or newer, run the CLI without a global installation:blog.json, blog/, or
changelog/. If you prefer a global installation:
http://localhost:4321. The blog is at /blog and the changelog at
/changelog, each only when the site has a blog/ or changelog/ folder (both
when it has neither). Restart after adding the other folder. / redirects to the
first one. Content, components, CSS, assets and configuration reload
when you edit them. If a file has an error, the browser shows it in place of the
page and reloads once you fix it. Drafts are included, and analytics integrations
are disabled. With translations, each language is served
below its section, like /blog/de, and languages you add to translations
appear without a restart.
No login, API key or deployment is required. The first run downloads the Sites
renderer; later runs reuse npm’s or Bun’s package cache, depending on the
selected runtime. Node users do not need Bun. Stop the server with Ctrl+C.
If port 4321 is taken, the next free port is used and printed. For a site in a
subfolder or a different local port:
--source selects the site root, not its blog/ directory. This command uses the
same renderer as hosted Notra Sites; it does not run your repository’s app or its
build scripts.
Check links before you push
notra dev prints link_broken and image_missing warnings on every reload, and notra sites validate prints them without starting a server:
notra sites validate also lists how many posts each language has translated and which are missing.
Without building the site, they check what they can be sure of: links to posts that don’t exist, images that aren’t in public/ and paths Notra can’t read. Headings (#section), tag and author pages, generated files and links in drafts are only checked when the site is built, by notra sites build or a deployment, so these commands never warn about a link the build accepts. They take your sections to be where sections in blog.json or notra dev --mount puts them, or else at /blog and /changelog, and leave links that use your site’s full address, like https://www.example.com/blog/launch, to the build.
In a monorepo
If your site lives inside a repository that uses Bun or pnpm catalogs, run the CLI with that package manager:npx reads the package.json at the root of your repository. If that file has overrides for a package that a workspace lists as catalog:, npm stops with Unsupported URL Type "catalog:" and Notra never runs. To keep using npx, run it from a folder outside the repository and point it at the site:
Pull request previews
Every pull request into the production branch gets a preview athttps://pr-<number>--<address>.notra.site, which updates with every new commit and goes away when the pull request is closed. The Notra Sites preview check on the pull request links to it. Pull requests from forks don’t get a preview, and if the site is in a subdirectory, a pull request that changes nothing in its folder doesn’t get one either.
Branch previews
To preview a branch without opening a pull request, open Deployments → Preview a branch, enter the branch name and click Create preview. Every push to the branch that changes the site updates the preview, and branch previews stay until you remove them with Delete preview.Post previews
Open a post’s Preview tab to build it on a Notra site without changing the repository or the live site. Choose Open for (1 hour, 1 day, 3 days, or 7 days) and optionally set a password. Update preview replaces the build at the same link. Changing the password or lifetime does not rebuild the site. The link closes when its lifetime ends. The daily cleanup then removes the preview reference and its saved post files, including files left by failed builds. Unreferenced site builds are removed at the next cleanup after the 24-hour build safety window. Delete closes the preview and removes its saved post files without waiting for expiry; site builds follow the same cleanup policy. The original post and repository files are not deleted. Expiry cleanup does not remove open branch or pull request previews, the live production deployment, or the last ten production builds retained for rollback. AI agents can build a post preview through the API and the MCP server.Who can open a preview
Set this under Settings → Previews, or with the access button on the Deployments page, which shows the current mode, for example Team only:
For a reviewer outside your workspace, choose Copy share link on a preview, and the link works for seven days.
What’s different in a preview
- Search engines never index previews, because every response sends
X-Robots-Tag: noindexandrobots.txtblocks all crawlers. - Notra only serves previews on Notra addresses and never on your own domain.
- Visits to previews don’t count in built-in Analytics. Analytics integrations, including Google Analytics 4, PostHog, Plausible, Umami, Rybbit, DataFast, OneDollarStats and Simple Analytics, are disabled in previews too. Verify incoming events on the live production site after publishing. Custom scripts still run in previews, so any tracking you install through them needs its own preview filter.