Skip to content

Commit ed5d073

Browse files
committed
Merge child method into parent block
1 parent ed1e32a commit ed5d073

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

packages/framework/src/Framework/Features/Navigation/BaseMenuGenerator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ protected function canAddRoute(Route $route): bool
8989
return false;
9090
}
9191

92+
if ($this->generatesSidebar) {
93+
// Since the index page is linked in the header, we don't want it in the sidebar
94+
return ! $route->is(DocumentationPage::homeRouteName());
95+
}
96+
9297
return true;
9398
}
9499

packages/framework/src/Framework/Features/Navigation/GeneratesDocumentationSidebarMenu.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Hyde\Framework\Features\Navigation;
66

7-
use Hyde\Support\Models\Route;
87
use Hyde\Pages\DocumentationPage;
98

109
use function collect;
@@ -37,13 +36,6 @@ protected function generate(): void
3736
$this->sortSidebarGroupsByLowestPriority();
3837
}
3938

40-
protected function canAddRoute(Route $route): bool
41-
{
42-
return parent::canAddRoute($route)
43-
// Since the index page is linked in the header, we don't want it in the sidebar
44-
&& ! $route->is(DocumentationPage::homeRouteName());
45-
}
46-
4739
protected function sortSidebarGroupsByLowestPriority(): void
4840
{
4941
// While the items accessor sorts the items upon retrieval,

0 commit comments

Comments
 (0)