Skip to content

Commit

Permalink
fix: showing versions just if section (plugin) has + more skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
banasa44 committed May 22, 2024
1 parent 22ad7ee commit 1ce791e
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 18 deletions.
2 changes: 1 addition & 1 deletion advanced/plugin-install/_category_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ collapsible: true
collapsed: false
label: Plugins install/uninstall
link: null
position: 1
position: 3
9 changes: 9 additions & 0 deletions docs/concepts/dao.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: DAO
sidebar_label: DAO
sidebar_position: 0
---

## DAO

This section will contain DAO definition.
9 changes: 9 additions & 0 deletions docs/concepts/permission-manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Permission Manager
sidebar_label: Permission Manager
sidebar_position: 3
---

## Permission Manager

This section will contain Permission Manager definition.
9 changes: 9 additions & 0 deletions docs/concepts/plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Plugin
sidebar_label: Plugin
sidebar_position: 2
---

## Plugin

This section will contain Plugin definition.
9 changes: 9 additions & 0 deletions docs/concepts/proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Proposal
sidebar_label: Proposal
sidebar_position: 3
---

## Proposal

This section will contain Proposal definition.
1 change: 0 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const config = {
versions: {
current: {
label: '1.4.0-alpha',
path: '1.4.0',
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion docs/01-get-started.mdx → guides/01-get-started.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: ''
sidebar_label: Get Started
sidebar_position: 0
sidebar_position: 1
hide_table_of_contents: true
---

Expand Down
2 changes: 1 addition & 1 deletion guides/dao/_category_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ collapsible: true
collapsed: true
label: DAO
link: null
position: 1
position: 2
2 changes: 1 addition & 1 deletion guides/framework/_category_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ collapsible: true
collapsed: true
label: Framework
link: null
position: 3
position: 4
2 changes: 1 addition & 1 deletion guides/plugin/_category_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ collapsible: true
collapsed: true
label: Plugin
link: null
position: 2
position: 3
17 changes: 5 additions & 12 deletions src/theme/NavbarItem/DocsVersionDropdownNavbarItem.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
import React from 'react';
import DocsVersionDropdownNavbarItem from '@theme-original/NavbarItem/DocsVersionDropdownNavbarItem';
import {useLocation} from '@docusaurus/router';
import {useActiveDocContext} from '@docusaurus/plugin-content-docs/client';

// We don't want to show the Versions Dropdown in the mainpage.
export default function DocsVersionDropdownNavbarItemWrapper(props) {
const {pathname} = useLocation();

const isRootPath = pathname === '' || pathname === '/';

// Render null if the pathname does not start with /docs
if (isRootPath) {
const {activeDoc} = useActiveDocContext(props.docsPluginId);
if (!activeDoc) {
return null;
}
return (
<>
<DocsVersionDropdownNavbarItem {...props} />
</>
);

return <DocsVersionDropdownNavbarItem {...props} />;
}

0 comments on commit 1ce791e

Please sign in to comment.