You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ur...@apache.org on 2022/09/05 07:28:22 UTC
[pulsar-site] branch main updated: quick versions swith (#201)
This is an automated email from the ASF dual-hosted git repository.
urfree pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
The following commit(s) were added to refs/heads/main by this push:
new 1b6a9d89823 quick versions swith (#201)
1b6a9d89823 is described below
commit 1b6a9d89823d983c9e33d406e5f828d6145dfd8f
Author: Li Li <ur...@apache.org>
AuthorDate: Mon Sep 5 15:28:18 2022 +0800
quick versions swith (#201)
---
.../src/theme/DocsVersionDropdownNavbarItem.js | 38 +++++++++++-----------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/site2/website-next/src/theme/DocsVersionDropdownNavbarItem.js b/site2/website-next/src/theme/DocsVersionDropdownNavbarItem.js
index 5c20c90ba3d..9eec119a8bd 100644
--- a/site2/website-next/src/theme/DocsVersionDropdownNavbarItem.js
+++ b/site2/website-next/src/theme/DocsVersionDropdownNavbarItem.js
@@ -14,17 +14,17 @@ import {
} from "@docusaurus/plugin-content-docs/client";
import { useDocsPreferredVersion } from "@docusaurus/theme-common";
import { translate } from "@docusaurus/Translate";
-// let versions = require("../../versions.json");
-// const _latestVersion = versions[0];
-// versions = [{ name: "current", label: "Master", path: "/docs/next" }].concat(
-// versions.map((item) => {
-// return {
-// label: item,
-// name: item,
-// path: item == _latestVersion ? "/docs" : "/docs/" + item,
-// };
-// })
-// );
+let versions = require("../../versions.json");
+const _latestVersion = versions[0];
+versions = [{ name: "current", label: "Next", path: "/docs/next" }].concat(
+ versions.map((item) => {
+ return {
+ label: item,
+ name: item,
+ path: item == _latestVersion ? "/docs" : "/docs/" + item,
+ };
+ }).slice(0, 5)
+);
const getVersionMainDoc = (version) =>
version.docs.find((doc) => doc.id === version.mainDocId);
@@ -42,14 +42,14 @@ export default function DocsVersionDropdownNavbarItem({
const latestVersion = useLatestVersion(docsPluginId);
const { preferredVersion, savePreferredVersionName } =
useDocsPreferredVersion(docsPluginId);
- const versions = [
- activeDocContext.activeVersion,
- {
- name: "others",
- label: "Other",
- path: "/versions",
- },
- ];
+ // const versions = [
+ // activeDocContext.activeVersion,
+ // {
+ // name: "others",
+ // label: "Other",
+ // path: "/versions",
+ // },
+ // ];
function getItems() {
const versionLinks = versions.map((version) => {
// We try to link to the same doc, in another version