Skip to content

Commit

Permalink
Add Version functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanbcbauer committed Jun 20, 2024
1 parent 3e05952 commit 74ecb9a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const config: Config = {
sidebarPath: './sidebars.ts',
versions: {
current: {
label: 'Jupiter (preview)',
label: 'Next',
},
},
},
Expand Down
14 changes: 14 additions & 0 deletions src/theme/NavbarItem/DocsVersionDropdownNavbarItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import DocsVersionDropdownNavbarItem from '@theme-original/NavbarItem/DocsVersionDropdownNavbarItem';
import { useLocation } from '@docusaurus/router';

export default function DocsVersionDropdownNavbarItemWrapper(props) {
const { docsPluginId, className, type } = props
const { pathname } = useLocation()

const doesPathnameContainDocsPluginId = pathname.includes("/docs/")
if (!doesPathnameContainDocsPluginId) {
return null
}
return <DocsVersionDropdownNavbarItem {...props} />;
}

0 comments on commit 74ecb9a

Please sign in to comment.