{showBreadcrumb &&
}
- {!showBreadcrumb &&
}
+ {!showBreadcrumb && (
+
+ )}
diff --git a/src/lib/docs/versionHref.test.ts b/src/lib/docs/versionHref.test.ts
new file mode 100644
index 0000000000..d465474633
--- /dev/null
+++ b/src/lib/docs/versionHref.test.ts
@@ -0,0 +1,15 @@
+import { describe, expect, test } from "vitest";
+import { docsVersionHref } from "./versionHref";
+
+describe("docsVersionHref", () => {
+ test("links the current stable version to latest", () => {
+ expect(docsVersionHref("v0.63", "v0.63")).toBe("/docs/latest/");
+ });
+
+ test.each([
+ ["v0.64", "/docs/v0.64/"],
+ ["v0.58", "/docs/v0.58/"],
+ ])("links other versions to their own docs: %s", (version, href) => {
+ expect(docsVersionHref(version, "v0.63")).toBe(href);
+ });
+});
diff --git a/src/lib/docs/versionHref.ts b/src/lib/docs/versionHref.ts
new file mode 100644
index 0000000000..bdc8372bff
--- /dev/null
+++ b/src/lib/docs/versionHref.ts
@@ -0,0 +1,6 @@
+// The current stable version links to /docs/latest/, so shared links stay
+// current after the next release instead of pinning a version number.
+export const docsVersionHref = (
+ version: string,
+ docsVersion: string,
+): string => (version === docsVersion ? "/docs/latest/" : `/docs/${version}/`);
diff --git a/src/pages/docs/all.astro b/src/pages/docs/all.astro
index 953d3147a9..ec61eea850 100644
--- a/src/pages/docs/all.astro
+++ b/src/pages/docs/all.astro
@@ -2,6 +2,7 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import NewDocsLayout from "@/layouts/NewDocsLayout.astro";
+import { docsVersionHref } from "@/lib/docs/versionHref";
import { baseCtx } from "@/lib/liquid/liquidRenderer";
const { site } = baseCtx;
@@ -51,7 +52,7 @@ const dirname = path.dirname(fileURLToPath(import.meta.url));
return (
-
+
{version}{" "}
{support.status === "unsupported" ? (