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/04/01 08:40:42 UTC
[pulsar-site] branch main updated: fix: version dropdown fix
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 2c8b575 fix: version dropdown fix
2c8b575 is described below
commit 2c8b575fe1635ed870635467b516760ad92d0a5c
Author: Li Li <ur...@apache.org>
AuthorDate: Fri Apr 1 16:40:31 2022 +0800
fix: version dropdown fix
Signed-off-by: Li Li <ur...@apache.org>
---
site2/website-next/docusaurus.config.js | 2 +-
.../src/theme/DocSidebar/Desktop/index.js | 21 ++++------------
.../src/theme/DocsVersionDropdownNavbarItem.js | 2 +-
site2/website-next/versions.json | 29 +---------------------
4 files changed, 8 insertions(+), 46 deletions(-)
diff --git a/site2/website-next/docusaurus.config.js b/site2/website-next/docusaurus.config.js
index 249ea0c..50bd0c7 100644
--- a/site2/website-next/docusaurus.config.js
+++ b/site2/website-next/docusaurus.config.js
@@ -172,7 +172,7 @@ module.exports = {
],
},
{
- to: "/docs/next",
+ to: "/docs/next/",
position: "right",
label: "Docs",
},
diff --git a/site2/website-next/src/theme/DocSidebar/Desktop/index.js b/site2/website-next/src/theme/DocSidebar/Desktop/index.js
index 0c9e37e..6b93f88 100644
--- a/site2/website-next/src/theme/DocSidebar/Desktop/index.js
+++ b/site2/website-next/src/theme/DocSidebar/Desktop/index.js
@@ -12,7 +12,6 @@ import CollapseButton from "@theme/DocSidebar/Desktop/CollapseButton";
import Content from "@theme/DocSidebar/Desktop/Content";
import styles from "./styles.module.css";
import DocsVersionDropdownNavbarItem from "../../DocsVersionDropdownNavbarItem";
-import BrowserOnly from "@docusaurus/BrowserOnly";
function DocSidebarDesktop({
path,
@@ -34,7 +33,11 @@ function DocSidebarDesktop({
)}
>
{hideOnScroll && <Logo tabIndex={-1} className={styles.sidebarLogo} />}
- <BrowserOnlyDocsVersionWrapper docsPluginId={docsPluginId} />
+ {path.indexOf("/docs/") > -1 ? (
+ <DocsVersionWrapperMemo docsPluginId={docsPluginId} />
+ ) : (
+ <></>
+ )}
<Content path={path} sidebar={sidebar} />
{hideableSidebar && <CollapseButton onClick={onCollapse} />}
</div>
@@ -57,18 +60,4 @@ function DocsVersionWrapper(props) {
const DocsVersionWrapperMemo = React.memo(DocsVersionWrapper);
-const BrowserOnlyDocsVersionWrapper = (props) => {
- return (
- <BrowserOnly>
- {() => {
- return location.pathname.indexOf("/docs/") > -1 ? (
- <DocsVersionWrapperMemo docsPluginId={props.docsPluginId} />
- ) : (
- <></>
- );
- }}
- </BrowserOnly>
- );
-};
-
export default React.memo(DocSidebarDesktop);
diff --git a/site2/website-next/src/theme/DocsVersionDropdownNavbarItem.js b/site2/website-next/src/theme/DocsVersionDropdownNavbarItem.js
index 526165a..3b152a7 100644
--- a/site2/website-next/src/theme/DocsVersionDropdownNavbarItem.js
+++ b/site2/website-next/src/theme/DocsVersionDropdownNavbarItem.js
@@ -43,7 +43,7 @@ export default function DocsVersionDropdownNavbarItem({
const latestVersion = useLatestVersion(docsPluginId);
const { preferredVersion, savePreferredVersionName } =
useDocsPreferredVersion(docsPluginId);
- console.log(activeDocContext);
+ // console.log(activeDocContext);
const versions = [
activeDocContext.activeVersion,
{
diff --git a/site2/website-next/versions.json b/site2/website-next/versions.json
index 9fc62bf..3c22abe 100644
--- a/site2/website-next/versions.json
+++ b/site2/website-next/versions.json
@@ -1,28 +1 @@
-[
- "2.9.1",
- "2.9.0",
- "2.8.2",
- "2.8.1",
- "2.8.0",
- "2.7.4",
- "2.7.3",
- "2.7.2",
- "2.7.1",
- "2.7.0",
- "2.6.4",
- "2.6.3",
- "2.6.2",
- "2.6.1",
- "2.6.0",
- "2.5.2",
- "2.5.1",
- "2.5.0",
- "2.4.2",
- "2.4.1",
- "2.4.0",
- "2.3.2",
- "2.3.1",
- "2.3.0",
- "2.2.1",
- "2.2.0"
-]
+["2.9.1", "2.9.0"]