From cc180de661f68269d6e45a978fbb45d4fcaef7de Mon Sep 17 00:00:00 2001 From: Marco Nenciarini Date: Tue, 25 Aug 2026 12:23:09 +0200 Subject: [PATCH] docs(web): use active doc version for install manifest link The install snippet always linked to the manifest of the latest released version, regardless of which versioned docs page it was rendered on. Viewing the 0.13.0 installation page therefore pointed at the 0.14.0 manifest. Fall back to the latest released version only when there is no active version, or the active version is the unreleased "current" docs. Signed-off-by: Marco Nenciarini --- web/src/components/Installation/index.tsx | 3 +-- web/src/hooks/versions.ts | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/web/src/components/Installation/index.tsx b/web/src/components/Installation/index.tsx index 064a0ea..9bf8fca 100644 --- a/web/src/components/Installation/index.tsx +++ b/web/src/components/Installation/index.tsx @@ -5,7 +5,7 @@ import {useCurrentVersion} from '@site/src/hooks/versions'; // InstallationSnippet is the kubectl incantation to install the lastest // available version of the Barman Cloud Plugin. export function InstallationSnippet(): ReactElement { - const latest = useCurrentVersion('latestReleased'); + const latest = useCurrentVersion('latest'); return ( {`kubectl apply -f \\ @@ -13,4 +13,3 @@ export function InstallationSnippet(): ReactElement { ); } - diff --git a/web/src/hooks/versions.ts b/web/src/hooks/versions.ts index 785cc2f..463e0f5 100644 --- a/web/src/hooks/versions.ts +++ b/web/src/hooks/versions.ts @@ -7,7 +7,10 @@ export function useCurrentVersion(fallback: 'latest' | 'latestReleased' = 'lates return useLatestReleasedVersion(); case 'latest': { const version = useActiveVersion('default'); - return version?.name ?? useLatestVersion('default')?.name; + if (version && version.name !== 'current') { + return version.name; + } + return useLatestReleasedVersion(); } default: // The following line ensures that if `fallback` is not 'latest' or 'latestReleased',