review: adapt installation page text and dev-snapshot section to the docs version

Signed-off-by: danishedb <danish.khan@enterprisedb.com>
This commit is contained in:
danishedb 2026-08-26 18:30:05 +05:30
parent 8a9aae168a
commit 2246df7602
No known key found for this signature in database
GPG Key ID: AECCB0164DA3A45C
4 changed files with 42 additions and 33 deletions

View File

@ -54,10 +54,9 @@ Both checks are required before proceeding with the installation.
## Installing the Barman Cloud Plugin ## Installing the Barman Cloud Plugin
import { InstallationSnippet } from '@site/src/components/Installation'; import { InstallationSnippet, ManifestVersion } from '@site/src/components/Installation';
Install the plugin using `kubectl` by applying the manifest for the latest Install the plugin using `kubectl` by applying the manifest for <ManifestVersion />:
release:
<InstallationSnippet /> <InstallationSnippet />
@ -98,12 +97,6 @@ deployment "barman-cloud" successfully rolled out
This confirms that the plugin is deployed and ready to use. This confirms that the plugin is deployed and ready to use.
## Testing the latest development snapshot import { DevSnapshotSection } from '@site/src/components/Installation';
You can also test the latest development snapshot of the plugin with the <DevSnapshotSection />
following command:
```sh
kubectl apply -f \
https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml
```

View File

@ -1,6 +1,7 @@
import {ReactElement} from 'react'; import {ReactElement} from 'react';
import CodeBlock from '@theme/CodeBlock'; import CodeBlock from '@theme/CodeBlock';
import {useActiveVersion} from '@docusaurus/plugin-content-docs/client'; import {useActiveVersion} from '@docusaurus/plugin-content-docs/client';
import Heading from '@theme/Heading';
// InstallationSnippet is the kubectl incantation to install the Barman // InstallationSnippet is the kubectl incantation to install the Barman
// Cloud Plugin: the manifest matching the doc version being viewed, or // Cloud Plugin: the manifest matching the doc version being viewed, or
@ -17,3 +18,32 @@ export function InstallationSnippet(): ReactElement<null> {
</CodeBlock> </CodeBlock>
); );
} }
// ManifestVersion names the manifest the snippet below installs: the
// release tag for a versioned docs page, or the main branch on Dev docs.
export function ManifestVersion(): ReactElement<null> {
const activeVersion = useActiveVersion('default');
return activeVersion && activeVersion.name !== 'current'
? <>version <code>v{activeVersion.name}</code></>
: <>the latest development snapshot from the <code>main</code> branch</>;
}
// DevSnapshotSection offers the main-branch manifest as an alternative;
// on the Dev docs the main install already is that manifest, so hide it.
export function DevSnapshotSection(): ReactElement<null> | null {
const activeVersion = useActiveVersion('default');
const url = 'https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml';
if (!activeVersion || activeVersion.name === 'current') return null;
return (
<>
<Heading as="h2" id="testing-the-latest-development-snapshot">
Testing the latest development snapshot
</Heading>
<CodeBlock language="sh">
{`kubectl apply -f \\
${url}`}
</CodeBlock>
</>
);
}

View File

@ -54,10 +54,9 @@ Both checks are required before proceeding with the installation.
## Installing the Barman Cloud Plugin ## Installing the Barman Cloud Plugin
import { InstallationSnippet } from '@site/src/components/Installation'; import { InstallationSnippet, ManifestVersion } from '@site/src/components/Installation';
Install the plugin using `kubectl` by applying the manifest for the latest Install the plugin using `kubectl` by applying the manifest for <ManifestVersion />:
release:
<InstallationSnippet /> <InstallationSnippet />
@ -98,12 +97,6 @@ deployment "barman-cloud" successfully rolled out
This confirms that the plugin is deployed and ready to use. This confirms that the plugin is deployed and ready to use.
## Testing the latest development snapshot import { DevSnapshotSection } from '@site/src/components/Installation';
You can also test the latest development snapshot of the plugin with the <DevSnapshotSection />
following command:
```sh
kubectl apply -f \
https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml
```

View File

@ -54,10 +54,9 @@ Both checks are required before proceeding with the installation.
## Installing the Barman Cloud Plugin ## Installing the Barman Cloud Plugin
import { InstallationSnippet } from '@site/src/components/Installation'; import { InstallationSnippet, ManifestVersion } from '@site/src/components/Installation';
Install the plugin using `kubectl` by applying the manifest for the latest Install the plugin using `kubectl` by applying the manifest for <ManifestVersion />:
release:
<InstallationSnippet /> <InstallationSnippet />
@ -98,12 +97,6 @@ deployment "barman-cloud" successfully rolled out
This confirms that the plugin is deployed and ready to use. This confirms that the plugin is deployed and ready to use.
## Testing the latest development snapshot import { DevSnapshotSection } from '@site/src/components/Installation';
You can also test the latest development snapshot of the plugin with the <DevSnapshotSection />
following command:
```sh
kubectl apply -f \
https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml
```