-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sidebar generation and display logic (#490)
* Fix sidebar generation and display logic This change fixes two issues that prevented auto-generated sidebar entries from appearing as highlighted in the sidebar when a user visits them: 1. The sidebar generator assumes that the table of contents page for a subsection can *either* be at the same level as its corresponding subdirectory *or* within that subdirectory. Currently, placing a page at both locations causes an unexpected reuslt. This change throws an error if a page exists at both locations. 2. The navigation component currently assumes that a docs page's slug begins with the slug of its parent menu page. However, this is not true if the menu page is within its corresponding directory. E.g., the sidebar generator treats `docs/pages/directory/directory/` as a valid slug for the menu page of `docs/pages/directory/`, but the navigation component would not show `docs/pages/directory/page1` as highlighted in that case. This change resolves this issue by recursively descending through an entry to determine whether one of its entries is highlighted, rather than using the URL path alone. * Fix types
- Loading branch information
Showing
4 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters