Release Notes
What changed in the v3.0.x line of @viteplus/versions. For the lines before it see Earlier releases.
INFO
This line is archived and no longer maintained. See the current release notes for the v3.1.x line, which opens addresses without a version on the latest version, keeps frontmatter links inside their version, and lists the versions newest first.
v3.0.0
Release branching: draft the next release in src while readers keep landing on the stable version. (#55)
versionsConfig: {
current: 'next', // src is served at /next/
latest: 'v2.x', // archive/v2.x is served at /v2.x/ and opened at /
versions: {
'v1.x': { label: 'v1.x (LTS)' }
}
}Migration: The current version's pages move from the root to
/<current>/, so an old link such as/guidenow answers 404. Only/still opens the latest version.Migration: An archive folder that carries the
currentlabel now stops the build, since both would publish under one URL. Setcurrentto the version that the sources hold, or rename the folder.Migration: The
VersionSwitchercomponent reads its versions fromthemeConfig.versioning, so a custom theme that renders it by hand drops theversioningPluginprop. A theme that still passes one giveslatestVersioninstead ofcurrentVersion, andversionsas an array.Migration: Every page now has its version in its path, so a nav
activeMatchsuch as^/guide/no longer matches. Write it as^/[^/]+/guide/to match the guide of every version, or^/v2\.x/guide/for one.Migration: The
rewritesHookhas to keep<locale>/<version>/at the front of every route, and a hook that puts the version first now stops the build. Only the part after the version is yours to reshape.Fixed: A locale with a
linksuch as/de/published its pages under<version>/de/and added a second set of locale entries. The slashes are now dropped, so the link gives the prefixde.Fixed: A nav link whose path contains
http, such as/guide/http-client, was taken for an external link and left out of its version.Fixed: The
VersionSwitchercomponent dropped every folder of the page that carried the name of a version, so switching fromv2.x/guide/next/setuplost thenextfolder. It also linked/de/<version>/for a version without German pages, which answered 404, and now links that version's own home page.Fixed: A locale whose
themeConfigwas empty shared one object among all its versions, so the last nav written won.Fixed:
sourceswritten as./srcorsrc/published every current page unversioned at/src/....Fixed: A nav link that already names a version, such as
/v1.x/release, or points at a public file, such as/files/a.pdf, is no longer prefixed with the version of the page.Fixed: An object in the user configuration was merged into a default array instead of replacing it, since the merge checked the user value twice instead of both values.
Added: The
latestoption names the stable version, the one readers open at the root. The sources can then hold the docs of a release that is not out yet, under theircurrentlabel, see How versions map to URLs.Added:
versionsholds per-version settings. Alabelchanges the text both version switchers show, such asv1.x (LTS), without moving any page.Added: A version's
pathpublishes it from a folder outsidearchive, such as a worktree of a release branch checked out inside the docs root.Added: Absolute links in markdown stay inside the version of the page that holds them, so
/guide/in an archived page leads to that version's guide. VitePress's dead link check sees the rewritten links.Added: A version setup that would publish the wrong pages fails the build with a message that names the problem: two versions with one name, a misspelled
latestorversionskey, or apathoutside the docs root, see Errors that stop the build.Added:
installVersionFallbackcatches a switch of version or language onto a page that does not exist there, such as the language menu on an untranslated page, and opens the home page of that version or language instead. Any other missing address keeps its 404 page. Add it toenhanceAppnext to theVersionSwitchercomponent.Added: A version whose
pathlies insidesourcesor an archive folder, or holds one, stops the build. Its pages used to go to the version of the outer folder, so the version published nothing.Added: Locales whose prefixes clash stop the build: two locales with one language and no
link, alinkof more than one segment, or a prefix that is also the name of a version.Changed: Every version is served under its own name, the current one included, so a link always names the version it was written for. The root opens the latest version's home page and shows
/v2.x/in the address bar without reloading the page, see The root URL. This replaces the 2.2.0 script that reloaded/<current>/…at the root.Changed: The site title links to the home page of the version the reader is on, instead of
/, which no version publishes. AlogoLinkof your own is kept.Changed: The versions, labels, and routes that the
VersionSwitcherreads are published once asthemeConfig.versioning, instead of in the props of the switcher in every locale entry. On this site that removes two thirds of the site data, and the saving grows with every locale and version.Changed: The switchers tag the
latestversion with(latest).Changed: Every page of every version runs through the
rewritesHook, including pages of the sources without a locale folder, which 2.x served at their own path without calling the hook.
Earlier releases
- v2.3.x - the 2.3 line (archived docs).
- v2.2.x - the 2.2 line (archived docs).
- v2.1.x - the 2.1 line (archived docs).
- v2.0.x - the 2.0 line (archived docs).
- v1.0.0 - initial release (archived docs).
