Skip to content

Commit

Permalink
Extract helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 14, 2023
1 parent d438c43 commit 5728f7a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
});
Expand Down Expand Up @@ -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']);
}
}

0 comments on commit 5728f7a

Please sign in to comment.