You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by vi...@apache.org on 2024/03/14 07:02:40 UTC

(pulsar-site) 01/01: Update docs only for actively maintained versions

This is an automated email from the ASF dual-hosted git repository.

visortelle pushed a commit to branch version-dropdown
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git

commit a7b35cf3d05672289665275d9c4c75907c63f4a8
Author: visortelle <vi...@gmail.com>
AuthorDate: Thu Mar 14 11:02:24 2024 +0400

    Update docs only for actively maintained versions
---
 contribute/document-contribution.md        |   6 +++-
 contribute/release-process.md              |  17 +++++++++-
 src/theme/DocsVersionDropdownNavbarItem.js |  51 +++++++++++++++--------------
 static/img/version-dropdown.png            | Bin 0 -> 60714 bytes
 4 files changed, 47 insertions(+), 27 deletions(-)

diff --git a/contribute/document-contribution.md b/contribute/document-contribution.md
index 1a236015ffa7..62128ab6fe2b 100644
--- a/contribute/document-contribution.md
+++ b/contribute/document-contribution.md
@@ -11,7 +11,11 @@ Currently, the source of documents and website (where the docs are finally publi
 
 ## Update versioned docs
 
-If you want to update versioned docs, go to [versioned_docs folder](https://github.com/apache/pulsar-site/tree/main/versioned_docs) to find your desired one.
+Documentation should be up to date for all [actively supported versions](https://pulsar.apache.org/contribute/release-policy/#supported-versions).
+
+No need to update documentation for versions that are not actively maintained unless the documentation is incorrect.
+
+To update versioned docs, go to [versioned_docs folder](https://github.com/apache/pulsar-site/tree/main/versioned_docs).
 
 For versions prior to 2.8, Pulsar releases versioned docs for each patch release. You can update the exact versioned doc.
 
diff --git a/contribute/release-process.md b/contribute/release-process.md
index 44bf62ede6e5..8bf0f938cef9 100644
--- a/contribute/release-process.md
+++ b/contribute/release-process.md
@@ -607,7 +607,22 @@ Read more on the manual of [pytools](https://github.com/apache/pulsar-site/tree/
 
 If you're working on a patch release for an older feature version of Pulsar, you can skip this step.
 
-Otherwise, you should update the version in this file: https://github.com/apache/pulsar-site/blob/26671a6ce02ed529eb26072846aedf14e4ab31a5/static/.htaccess#L19
+Otherwise, you should update the version in this file: <https://github.com/apache/pulsar-site/blob/26671a6ce02ed529eb26072846aedf14e4ab31a5/static/.htaccess#L19>
+
+## Update `/docs` version list dropdown
+
+The dropdown should have the following items:
+- Next
+- Active versions [still in support](/contribute/release-policy/#supported-versions)
+- Others
+
+LTS versions should be labeled this way: `<version> LTS`.
+
+<img alt="docs version dropdown" src="/img/version-dropdown.png" width="320px" />
+
+If you're working on a patch release for an older feature version of Pulsar, you can skip this step.
+
+Otherwise, you should update the dropdown version list in this file: <https://github.com/apache/pulsar-site/blob/main/src/theme/DocsVersionDropdownNavbarItem.js>
 
 ## Announce the release
 
diff --git a/src/theme/DocsVersionDropdownNavbarItem.js b/src/theme/DocsVersionDropdownNavbarItem.js
index 35bff76814fe..f6264868d130 100644
--- a/src/theme/DocsVersionDropdownNavbarItem.js
+++ b/src/theme/DocsVersionDropdownNavbarItem.js
@@ -7,27 +7,28 @@
 import React from "react";
 import DefaultNavbarItem from "@theme/NavbarItem/DefaultNavbarItem";
 import DropdownNavbarItem from "@theme/NavbarItem/DropdownNavbarItem";
-import {useActiveDocContext, useLatestVersion,} from "@docusaurus/plugin-content-docs/client";
-import {useDocsPreferredVersion} from "@docusaurus/theme-common";
-import {translate} from "@docusaurus/Translate";
+import { useActiveDocContext, useLatestVersion, } from "@docusaurus/plugin-content-docs/client";
+import { useDocsPreferredVersion } from "@docusaurus/theme-common";
+import { translate } from "@docusaurus/Translate";
 
-let versions = require("../../versions.json");
-versions = [{ name: "current", label: "Next", path: "/docs/next" }]
-  .concat(
-    versions.map((item) => {
-      return {
-        label: item,
-        name: item,
-        path: "/docs/" + item,
-      };
-    })
-  )
-  .slice(0, 5)
-  .concat({
-    name: "others",
-    label: "Others",
-    path: "/versions",
-  });
+const versions = [{ name: "current", label: "Next", path: "/docs/next" }]
+  .concat([
+    {
+      label: '3.2.x',
+      name: '3.2.x',
+      path: `/docs/3.2.x`,
+    },
+    {
+      label: '3.0.x LTS',
+      name: '3.0.x',
+      path: `/docs/3.0.x`,
+    },
+    {
+      name: "others",
+      label: "Others",
+      path: "/versions",
+    }
+  ]);
 
 const getVersionMainDoc = (version) =>
   version.docs.find((doc) => doc.id === version.mainDocId);
@@ -74,11 +75,11 @@ export default function DocsVersionDropdownNavbarItem({
   const dropdownLabel =
     mobile && items.length > 1
       ? translate({
-          id: "theme.navbar.mobileVersionsDropdown.label",
-          message: "Versions",
-          description:
-            "The label for the navbar versions dropdown on mobile view",
-        })
+        id: "theme.navbar.mobileVersionsDropdown.label",
+        message: "Versions",
+        description:
+          "The label for the navbar versions dropdown on mobile view",
+      })
       : dropdownVersion.label;
   const dropdownTo =
     mobile && items.length > 1
diff --git a/static/img/version-dropdown.png b/static/img/version-dropdown.png
new file mode 100644
index 000000000000..047302de81a7
Binary files /dev/null and b/static/img/version-dropdown.png differ