From 22066bfe29fb977469c714a3a928b00c4dffdcc6 Mon Sep 17 00:00:00 2001 From: Danish Date: Thu, 27 Aug 2026 14:25:22 +0530 Subject: [PATCH] docs(web): show the doc version in the install manifest text (#1077) The installation page said "the manifest for the latest release" everywhere, even on older versioned docs and on the unreleased Dev docs. Show the actual version instead (or "the latest development snapshot from the main branch" on Dev docs). The "Testing the latest development snapshot" section now explains, on Dev docs, that the command above already installs that snapshot, instead of duplicating it. Signed-off-by: Danish --- web/docs/installation.mdx | 13 ++----- web/src/components/Installation/index.tsx | 38 ++++++++++++++++++- .../version-0.13.0/installation.mdx | 13 ++----- .../version-0.14.0/installation.mdx | 13 ++----- 4 files changed, 49 insertions(+), 28 deletions(-) diff --git a/web/docs/installation.mdx b/web/docs/installation.mdx index 027d1e8..4c1c48a 100644 --- a/web/docs/installation.mdx +++ b/web/docs/installation.mdx @@ -54,10 +54,9 @@ Both checks are required before proceeding with the installation. ## 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 -release: +Install the plugin using `kubectl` by applying the manifest for : @@ -100,10 +99,6 @@ This confirms that the plugin is deployed and ready to use. ## Testing the latest development snapshot -You can also test the latest development snapshot of the plugin with the -following command: +import { DevSnapshotSection } from '@site/src/components/Installation'; -```sh -kubectl apply -f \ - https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml -``` + diff --git a/web/src/components/Installation/index.tsx b/web/src/components/Installation/index.tsx index b149709..359bd95 100644 --- a/web/src/components/Installation/index.tsx +++ b/web/src/components/Installation/index.tsx @@ -2,6 +2,10 @@ import {ReactElement} from 'react'; import CodeBlock from '@theme/CodeBlock'; import {useActiveVersion} from '@docusaurus/plugin-content-docs/client'; +// DEV_MANIFEST_URL is the URL of the manifest.yaml on the main branch of the plugin repo. +const DEV_MANIFEST_URL = + 'https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml'; + // InstallationSnippet is the kubectl incantation to install the Barman // Cloud Plugin: the manifest matching the doc version being viewed, or // (on the unreleased "current" docs) the latest manifest on main. @@ -9,7 +13,7 @@ export function InstallationSnippet(): ReactElement { const activeVersion = useActiveVersion('default'); const url = activeVersion && activeVersion.name !== 'current' ? `https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/v${activeVersion.name}/manifest.yaml` - : 'https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml'; + : DEV_MANIFEST_URL; return ( {`kubectl apply -f \\ @@ -17,3 +21,35 @@ export function InstallationSnippet(): ReactElement { ); } + +// 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 { + const activeVersion = useActiveVersion('default'); + return activeVersion && activeVersion.name !== 'current' + ? v{activeVersion.name} + : <>the latest development snapshot from the main 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 { + const activeVersion = useActiveVersion('default'); + if (!activeVersion || activeVersion.name === 'current') { + return ( +

The install + command above already applies the latest development + snapshot from the main branch.

+ ); + } + return ( + <> +

You can also test the latest development snapshot of the plugin + with the following command:

+ + {`kubectl apply -f \\ + ${DEV_MANIFEST_URL}`} + + + ); +} diff --git a/web/versioned_docs/version-0.13.0/installation.mdx b/web/versioned_docs/version-0.13.0/installation.mdx index 027d1e8..4c1c48a 100644 --- a/web/versioned_docs/version-0.13.0/installation.mdx +++ b/web/versioned_docs/version-0.13.0/installation.mdx @@ -54,10 +54,9 @@ Both checks are required before proceeding with the installation. ## 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 -release: +Install the plugin using `kubectl` by applying the manifest for : @@ -100,10 +99,6 @@ This confirms that the plugin is deployed and ready to use. ## Testing the latest development snapshot -You can also test the latest development snapshot of the plugin with the -following command: +import { DevSnapshotSection } from '@site/src/components/Installation'; -```sh -kubectl apply -f \ - https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml -``` + diff --git a/web/versioned_docs/version-0.14.0/installation.mdx b/web/versioned_docs/version-0.14.0/installation.mdx index 027d1e8..4c1c48a 100644 --- a/web/versioned_docs/version-0.14.0/installation.mdx +++ b/web/versioned_docs/version-0.14.0/installation.mdx @@ -54,10 +54,9 @@ Both checks are required before proceeding with the installation. ## 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 -release: +Install the plugin using `kubectl` by applying the manifest for : @@ -100,10 +99,6 @@ This confirms that the plugin is deployed and ready to use. ## Testing the latest development snapshot -You can also test the latest development snapshot of the plugin with the -following command: +import { DevSnapshotSection } from '@site/src/components/Installation'; -```sh -kubectl apply -f \ - https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml -``` +