Skip to content
✨ Publier v1 is live — a polished docs platform built for the open web.
On this page

Version lifecycle

Publish a new documentation version, keep one current and one supported, freeze the older ones, and retire their URLs, with what Publier does and does not do at each step.

A documentation version is a folder of pages plus an entry in the header’s version menu. Publier does not copy, branch or archive content for you: you publish each version’s pages, then wire them into navigation. This guide follows one version through its life: publish it, keep it supported, freeze it, retire it.

The selector fields (label, path, badge, default, status) are specified in Documentation products and versions. The standalone VersionSwitcher component and the older site-wide docs.sidebar.versions list are covered in Versioning. This page does not repeat either.

Publish a new version

Adding a version takes three edits.

1. A content folder per version. The folder decides the URL. Give each version a landing page:

src/content/docs
compute/
├── index.mdx → /docs/compute
├── v1/
│ ├── index.mdx → /docs/compute/v1
│ └── instances.mdx
└── v2/
├── index.mdx → /docs/compute/v2
└── instances.mdx

2. A versions entry on the product. Each entry needs a label and a path inside the product’s prefix. badge, default and status are optional:

publier.config.yaml
nav:
docs:
products:
- label: Compute
path: /docs/compute
href: /docs/compute/v2
versions:
- { label: v2, path: /docs/compute/v2, status: current }
- { label: v1, path: /docs/compute/v1, status: supported }

status is current, supported, frozen or preview. A product keeps at most one current and one supported version; every older one is frozen. A label that is empty, a path outside the product, a repeated path, a second default: true, a second current or supported, or a frozen default fails the build with the field path.

3. A docs.tabSections entry for each version path. This is the step that is easy to miss:

publier.config.yaml
docs:
tabSections: [compute/v2, compute/v1]

Entries are folder paths under src/content/docs, with no /docs/ prefix. Each section gets its own sidebar, and a page belongs to the longest section that contains it. A version path in versions does not create a section: the default docs route adds sections for a product’s tabs destinations under /docs/, but not for versions paths. A version folder with no tabSections entry belongs to no section, so its pages land in the root sidebar together with every other page that belongs to no section. With the entries above, a page under /docs/compute/v2 shows only the v2 tree in its sidebar, and a page under /docs/compute/v1 shows only v1.

When v3 ships, add compute/v3 to the content tree, add its versions entry as current, make v2 supported and v1 frozen, and add compute/v3 to tabSections.

What readers see

The default docs route renders the product and version menus in the header. Each version appears in the menu in the order of your versions list, with its badge after the label; frozen versions follow under an Archived heading. The badge is free text, so use whatever short word fits (stable, beta). It is shown on the menu option only, not on the menu’s trigger button.

Picking a version keeps the reader on the same page when that version has it: a reader on /docs/compute/v1/instances who picks v2 arrives at /docs/compute/v2/instances. When the target version has no such page, the menu goes to that version’s path, which should be its landing page. The sidebar of the default docs route has no version switcher; the header menu is the only one there.

When a page isn’t in the version you switch to

When the other version does not have the page, the link opens that version’s overview and adds ?publier-from=<page path> to the address. A short notice at the top of the page names the version, for example “The page you were reading isn’t in v1. You’re on its overview.” The notice has a Dismiss button and shows once: Publier removes the publier-from parameter from the address after showing it, so reloading or sharing the link does not repeat it. Only Publier writes this parameter; a version’s href and path in your config stay plain paths.

What default: true does

The selector chooses the version to show by longest matching path against the current URL. default: true is used only when no version path matches, for example on the product landing page /docs/compute in the layout above, which sits under the product but under neither version. Then the menu shows the default version, else the current one, else the first entry.

That is all it does. It does not redirect (/docs/compute stays a real page), and it has no effect on canonical links, the sitemap, llms.txt or search. Every live version stays in the sitemap, in llms.txt and in the Markdown exports, whichever one is the default.

Freeze an old version

Set an old version’s status to frozen. Every page in it then opens with a notice that this is archived documentation for that version, linking the current version’s landing page, and the menu lists it under Archived. A preview version’s pages open with a notice that it may change or be removed. current and supported pages carry no notice.

publier.config.yaml
versions:
- { label: v3, path: /docs/compute/v3, status: current }
- { label: v2, path: /docs/compute/v2, status: supported }
- { label: v1, path: /docs/compute/v1, status: frozen }

A frozen version’s pages stay published at their URLs, in the sitemap, llms.txt and the Markdown exports. Publier does not stop you editing them; freezing is the statement that you no longer will. Search engines are pointed at the current version; see Search engines and older versions.

Search engines and older versions

A page in a supported or frozen version whose same page exists in the current version declares a canonical link to that current page, so search engines send readers to the current documentation. A page with no counterpart in the current version declares no canonical link, so search engines treat its own address as canonical. Set site.url in publier.config.yaml; without it no canonical is written.

publier.config.yaml
site:
url: https://docs.example.com

A canonical you set yourself in a page’s head frontmatter always wins, and a page never gets two. The current version’s pages are not changed. The sitemap and llms.txt still list every live version.

Retire a version’s URLs

When a version, or a single page, is withdrawn, remove its content, drop its versions and tabSections entries, and redirect each old URL with Astro’s redirects option in astro.config.ts. One entry per URL:

astro.config.ts
export default defineConfig({
// ...integrations unchanged
redirects: {
// A retired version root and a removed page.
'/docs/compute/v0': '/docs/compute/v2',
'/docs/compute/v1/removed-page': '/docs/compute/v1/instances',
},
});

On a static build without a host adapter, Astro writes a small HTML page with a <meta http-equiv="refresh"> tag at each old URL. That is a client-side redirect, not an HTTP 301 or 308, and Astro documents that the stub does not support status codes. See Migrate existing docs for what that means at your host. Astro also documents that a redirect has lower precedence than an existing page file of the same name, so delete the old page’s content rather than leaving both.

Those stubs stay out of the published surfaces. In the framework’s own build they were absent from llms.txt, the Markdown exports and the sitemap, and search does not index them: Pagefind skips every page without a data-pagefind-body attribute once any page has one, and the stubs lack it. Redirects stay per URL: list every old URL that readers or other sites may still link to, pointing each at the closest live page, usually the new version’s landing page.

Search follows the version being read

By default, search from a page in a declared version returns that version’s pages plus pages that belong to no version, so a v2 reader does not see v1 duplicates. Each docs page in a version carries a Pagefind version filter holding its label, and every other docs page carries every label so it stays in each version’s results.

To search every version from every page, set search.versions: all in publier.config.yaml. The default is current; any other value fails the build. A custom page that carries its own data-pagefind-body gets every declared label at build time, so it appears in scoped results from any version. From a page outside every version, search returns every version. The page sets the scope, so the dialog shows no version filter for readers to change. It does show an Include archived versions checkbox when the site has a frozen version.

Pages in a frozen version are left out of search by default, whatever search.versions says; ticking the checkbox adds them. Search can also be scoped by product. See Search.