-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Refactor documentation sidebar to use routes #286
Conversation
Merge trait HasDocumentationSidebarCategories into DocumentationSidebarService
@@ -23,7 +23,7 @@ public function __construct() | |||
|
|||
public static function create(?RouteContract $currentRoute = null): static | |||
{ | |||
return (new self())->setCurrentRoute($currentRoute ?? Hyde::currentRoute())->generate()->filter()->sort(); | |||
return (new static())->setCurrentRoute($currentRoute ?? Hyde::currentRoute())->generate()->filter()->sort(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix unsafe usage of new static
Codecov Report
@@ Coverage Diff @@
## master #286 +/- ##
===========================================
Coverage 100.00% 100.00%
+ Complexity 818 801 -17
===========================================
Files 100 97 -3
Lines 2052 2006 -46
===========================================
- Hits 2052 2006 -46
Continue to review full report at Codecov.
|
This PR refactors how the documentation sidebar is generated. The main class responsible for generating it is now extending the base navigation menu, and the sidebar items are now NavItems. This makes it more maintainable as overlapping code is reduced. It also means we properly utilize routes for the sidebar.