diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index d9cf4c12b14..7d9f19599f8 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -22,6 +22,7 @@ This release is the first since the official release of HydePHP 1.0.0. It contai - Fixed https://github.com/hydephp/develop/issues/1301 in https://github.com/hydephp/develop/pull/1302 - Fixed https://github.com/hydephp/develop/issues/1313 in https://github.com/hydephp/develop/commit/134776a1e4af395dab5c15d611fc64c9ebce8596 - Fixed https://github.com/hydephp/develop/issues/1316 in https://github.com/hydephp/develop/pull/1317 +- Fixed https://github.com/hydephp/develop/issues/1318 in https://github.com/hydephp/develop/pull/1319 - Added missing function imports in https://github.com/hydephp/develop/pull/1309 ### Security diff --git a/packages/framework/src/Framework/Factories/NavigationDataFactory.php b/packages/framework/src/Framework/Factories/NavigationDataFactory.php index fb75f0d17a8..0a4a90a48c4 100644 --- a/packages/framework/src/Framework/Factories/NavigationDataFactory.php +++ b/packages/framework/src/Framework/Factories/NavigationDataFactory.php @@ -90,7 +90,8 @@ protected function makeHidden(): bool return $this->isInstanceOf(MarkdownPost::class) || $this->searchForHiddenInFrontMatter() || in_array($this->routeKey, Config::getArray('hyde.navigation.exclude', ['404'])) - || ! $this->isInstanceOf(DocumentationPage::class) && $this->pageIsInSubdirectory() && ($this->getSubdirectoryConfiguration() === 'hidden'); + || (! $this->isInstanceOf(DocumentationPage::class) && $this->pageIsInSubdirectory() && ($this->getSubdirectoryConfiguration() === 'hidden')) + && (basename($this->identifier) !== 'index'); } protected function makePriority(): int diff --git a/packages/framework/tests/Feature/HydePageTest.php b/packages/framework/tests/Feature/HydePageTest.php index b35e55f1fe1..99f85c4cf35 100644 --- a/packages/framework/tests/Feature/HydePageTest.php +++ b/packages/framework/tests/Feature/HydePageTest.php @@ -1224,6 +1224,13 @@ public function test_all_core_extension_pages_are_discoverable() } } + public function test_nested_index_pages_show_up_in_navigation() + { + $page = MarkdownPage::make('foo/index'); + $this->assertTrue($page->showInNavigation()); + $this->assertSame('Foo', $page->navigationMenuLabel()); + } + protected function assertSameIgnoringDirSeparatorType(string $expected, string $actual): void { $this->assertSame(