mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-09-04 14:12:21 +02:00
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 <marco.nenciarini@enterprisedb.com>
This commit is contained in:
parent
77118ed413
commit
cc180de661
@ -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<null> {
|
||||
const latest = useCurrentVersion('latestReleased');
|
||||
const latest = useCurrentVersion('latest');
|
||||
return (
|
||||
<CodeBlock language="sh">
|
||||
{`kubectl apply -f \\
|
||||
@ -13,4 +13,3 @@ export function InstallationSnippet(): ReactElement<null> {
|
||||
</CodeBlock>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -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',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user