From 5728f7ad29a4295d3fb003cdb533feaf6f199f17 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Thu, 14 Dec 2023 10:38:23 +0100 Subject: [PATCH] Extract helper method --- .../Actions/GeneratesDocumentationSearchIndex.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Actions/GeneratesDocumentationSearchIndex.php b/packages/framework/src/Framework/Actions/GeneratesDocumentationSearchIndex.php index 368895b599d..dfc7c4f95d8 100644 --- a/packages/framework/src/Framework/Actions/GeneratesDocumentationSearchIndex.php +++ b/packages/framework/src/Framework/Actions/GeneratesDocumentationSearchIndex.php @@ -59,7 +59,7 @@ protected function __construct() protected function run(): void { DocumentationPage::all()->each(function (DocumentationPage $page): void { - if (! in_array($page->identifier, array_merge(Config::getArray('docs.exclude_from_search', []), ['search']))) { + if (! in_array($page->identifier, $this->getPagesToExcludeFromSearch())) { $this->index->push($this->generatePageEntry($page)); } }); @@ -103,4 +103,9 @@ protected function getPath(): string { return Hyde::sitePath(DocumentationPage::outputDirectory().'/search.json'); } + + protected function getPagesToExcludeFromSearch(): array + { + return array_merge(Config::getArray('docs.exclude_from_search', []), ['search']); + } }