diff --git a/packages/framework/src/Framework/Features/Documentation/DocumentationSearchPage.php b/packages/framework/src/Framework/Features/Documentation/DocumentationSearchPage.php index e3070f59897..d5d90690c25 100644 --- a/packages/framework/src/Framework/Features/Documentation/DocumentationSearchPage.php +++ b/packages/framework/src/Framework/Features/Documentation/DocumentationSearchPage.php @@ -54,7 +54,8 @@ protected static function anotherSearchPageExists(): bool return Hyde::pages()->first(fn (HydePage $file): bool => $file->getRouteKey() === static::routeKey()) !== null; } - protected static function routeKey(): string + /** @deprecated Can be removed by https://github.com/hydephp/develop/pull/1498 */ + public static function routeKey(): string { return ltrim(DocumentationPage::outputDirectory().'/search'); } diff --git a/packages/framework/tests/Feature/DocumentationSearchPageTest.php b/packages/framework/tests/Feature/DocumentationSearchPageTest.php index 9f1d2546bec..cfb45b76a0c 100644 --- a/packages/framework/tests/Feature/DocumentationSearchPageTest.php +++ b/packages/framework/tests/Feature/DocumentationSearchPageTest.php @@ -59,4 +59,15 @@ public function testEnabledIsFalseWhenDisabledAndRouteExists() Hyde::pages()->put('docs/search', new InMemoryPage('docs/search')); $this->assertFalse(DocumentationSearchPage::enabled()); } + + public function testStaticRouteKeyHelper() + { + $this->assertSame('docs/search', DocumentationSearchPage::routeKey()); + } + + public function testStaticRouteKeyHelperWithCustomOutputDirectory() + { + DocumentationPage::setOutputDirectory('foo'); + $this->assertSame('foo/search', DocumentationSearchPage::routeKey()); + } }