mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-09-05 06:32:21 +02:00
Define functions that can be used in mdx pages to dinamically choose the correct version according to the documentation page viewed. Closes #343 Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com> Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
17 lines
596 B
TypeScript
17 lines
596 B
TypeScript
import {ReactElement} from 'react';
|
|
import CodeBlock from '@theme/CodeBlock';
|
|
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');
|
|
return (
|
|
<CodeBlock language="sh">
|
|
{`kubectl apply -f \\
|
|
https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/v${latest}/manifest.yaml`}
|
|
</CodeBlock>
|
|
);
|
|
}
|
|
|