Skip to content

Commit

Permalink
Inline added simplified experimental method
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 14, 2023
1 parent 01cba90 commit 57bdecb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Hyde\Foundation\Facades\Pages;
use Hyde\Framework\Actions\StaticPageBuilder;
use LaravelZero\Framework\Commands\Command;
use Hyde\Framework\Actions\GeneratesDocumentationSearchIndex;
use Hyde\Framework\Features\Documentation\DocumentationSearchPage;
use Hyde\Framework\Features\Documentation\DocumentationSearchIndex;

/**
* Run the build process for the documentation search index.
Expand All @@ -23,7 +23,7 @@ class BuildSearchCommand extends Command

public function handle(): int
{
StaticPageBuilder::handle(Pages::get('search.json') ?? GeneratesDocumentationSearchIndex::makePage());
StaticPageBuilder::handle(Pages::get('search.json') ?? DocumentationSearchIndex::make());

if (DocumentationSearchPage::enabled()) {
StaticPageBuilder::handle(Pages::get('docs/search') ?? new DocumentationSearchPage());
Expand Down
4 changes: 2 additions & 2 deletions packages/framework/src/Foundation/HydeCoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
use Hyde\Foundation\Kernel\PageCollection;
use Hyde\Foundation\Concerns\HydeExtension;
use Hyde\Facades\Features;
use Hyde\Framework\Actions\GeneratesDocumentationSearchIndex;
use Hyde\Framework\Features\Documentation\DocumentationSearchPage;
use Hyde\Framework\Features\Documentation\DocumentationSearchIndex;

use function array_filter;
use function array_keys;
Expand All @@ -35,7 +35,7 @@ public static function getPageClasses(): array
public function discoverPages(PageCollection $collection): void
{
if (Features::hasDocumentationSearch()) {
$collection->addPage(GeneratesDocumentationSearchIndex::makePage());
$collection->addPage(DocumentationSearchIndex::make());

if (DocumentationSearchPage::enabled()) {
$collection->addPage(new DocumentationSearchPage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
use Hyde\Hyde;
use Hyde\Facades\Config;
use Hyde\Facades\Filesystem;
use Hyde\Pages\InMemoryPage;
use Hyde\Framework\Concerns\InteractsWithDirectories;
use Hyde\Pages\DocumentationPage;
use Illuminate\Support\Collection;
use Hyde\Framework\Features\Documentation\DocumentationSearchIndex;

use function basename;
use function in_array;
Expand Down Expand Up @@ -52,12 +50,6 @@ public static function generate(): string
return $service->index->toJson();
}

/** @experimental May be moved to a DocumentationSearch class */
public static function makePage(): InMemoryPage
{
return DocumentationSearchIndex::make();
}

protected function __construct()
{
$this->index = new Collection();
Expand Down

0 comments on commit 57bdecb

Please sign in to comment.