Skip to content

Commit

Permalink
Merge pull request #555 from hydephp/develop
Browse files Browse the repository at this point in the history
Improve the full page documentation search
  • Loading branch information
caendesilva authored Jun 24, 2022
2 parents 152b54a + 59cefe6 commit 7b26a79
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions resources/views/layouts/docs.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
@endphp
<article id="document" itemscope itemtype="http://schema.org/Article" @class(['mx-auto lg:ml-8 prose dark:prose-invert
max-w-3xl', 'torchlight-enabled'=> $document->hasTorchlight()])>

@yield('content')

<header id="document-header">
{!! $document->renderHeader() !!}
</header>
Expand Down
16 changes: 13 additions & 3 deletions resources/views/pages/documentation-search.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<h1>Search the documentation site</h1>
<style>#searchMenuButton{display:none!important;}#search-results{max-height:unset!important;}</style>
@include('hyde::components.docs.search-input')
@php
$page = new \Hyde\Framework\Models\DocumentationPage([], '', 'Search', 'search');
$title = 'Search';
$currentPage = $page->getCurrentPagePath();
$markdown = '';
@endphp

@extends('hyde::layouts.docs')
@section('content')
<h1>Search the documentation site</h1>
<style>#searchMenuButton{display:none!important;}#search-results{max-height:unset!important;}</style>
@include('hyde::components.docs.search-input')
@endsection
8 changes: 1 addition & 7 deletions src/Commands/HydeBuildSearchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Hyde\Framework\Actions\GeneratesDocumentationSearchIndexFile;
use Hyde\Framework\Hyde;
use Hyde\Framework\Models\DocumentationPage;
use Hyde\Framework\Services\CollectionService;
use LaravelZero\Framework\Commands\Command;

Expand Down Expand Up @@ -61,12 +60,7 @@ protected function createSearchPage(): void
$this->comment('Generating search page...');
file_put_contents(
Hyde::path('_site/'.config('docs.output_directory', 'docs').'/search.html'),
view('hyde::layouts.docs')->with([
'page' => new DocumentationPage([], '', 'Search', 'search'),
'title' => 'Search',
'markdown' => view('hyde::pages.documentation-search')->render(),
'currentPage' => ''.config('docs.output_directory', 'docs').'/search',
])->render()
view('hyde::pages.documentation-search')->render()
);

$this->line(' > Created <info>_site/'.config('docs.output_directory', 'docs').'/search.html</> in '.
Expand Down

0 comments on commit 7b26a79

Please sign in to comment.