Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improve navigation structure #984

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/_assets/css/_includes/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@

h6 {
margin-bottom: 0;
text-transform: uppercase;
}

&:hover {
Expand All @@ -92,9 +91,9 @@
}

#sidebar {
// Work around Firefox bug
// https://moduscreate.com/blog/how-to-fix-overflow-issues-in-css-flex-layouts/
min-height: 0;
// Work around Firefox bug
// https://moduscreate.com/blog/how-to-fix-overflow-issues-in-css-flex-layouts/
min-height: 0;
}

.section-nav {
Expand Down
14 changes: 10 additions & 4 deletions src/_data/documentation_categories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,30 @@
- title: Platforms
slug: platforms

- title: Legacy Clients
slug: clients
hide_when_inactive: true

- title: Command Line Interface
slug: cli
hide_when_inactive: true

- title: API Reference
slug: api
hide_when_inactive: true

- title: Legacy Clients
slug: clients
hide_when_inactive: true

- title: On-Premise
slug: server
hide_when_inactive: true

- title: Development
slug: development
hide_when_inactive: true

- title: Security
slug: security
hide_when_inactive: true

- title: Support
slug: support
hide_when_inactive: true
6 changes: 6 additions & 0 deletions src/_js/lib/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ $(document).on('page.didUpdate', function(event) {
const containsActive = $branch.find('[data-sidebar-link]').is($active);

const isSection = $sections.is(el);
const isDirectChildOfSection =
!isSection && $sections.is(el.parentNode.parentNode);
const isDirectChildOfHiddenSection =
isDirectChildOfSection &&
$(el.parentNode.parentNode).data('hide-when-inactive') !== undefined;

switch (true) {
case containsActive:
case isSection:
case isDirectChildOfSection && !isDirectChildOfHiddenSection:
case parentTreeContainsActive && !hideWhenNoActiveChild:
$branch.removeClass('collapse');
break;
Expand Down