Skip to content

Commit

Permalink
Merge branch '2.x-dev' into new-asset-system
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Nov 16, 2024
2 parents b418b52 + 24929b9 commit cd2a400
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 8 deletions.
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ This serves two purposes:
- The `Markdown::render()` method will now always render Markdown using the custom HydePHP Markdown service (thus getting smart features like our Markdown processors) in https://github.com/hydephp/develop/pull/1900
- Improved how the `MarkdownService` class is accessed, by binding it into the service container, in https://github.com/hydephp/develop/pull/1922
- Improved the media asset transfer build task to have better output in https://github.com/hydephp/develop/pull/1904
- The full page documentation search now generates it's heading using smarter natural language processing based on the configured sidebar header in https://github.com/hydephp/develop/pull/2032
- Moved Blade view `hyde::pages.documentation-search` to `hyde::pages.docs.search` in https://github.com/hydephp/develop/pull/2033
- **Many MediaFile related helpers have been changed or completely rewritten** to provide a simplified API for interacting with media files.
- **Note:** For most end users, the changes will have minimal direct impact, but if you have custom code that interacts with media files, you may need to update it.
- The `Asset` facade has been restructured to be more scoped and easier to use, splitting out a separate `HydeFront` facade and inlining the `AssetService` class.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
@extends('hyde::layouts.docs')
@section('content')
<h1>Search the documentation site</h1>
@php
$title = Config::getString('docs.sidebar.header', 'Documentation');
$searchTitle = str_ends_with(strtolower($title), ' docs')
? 'Search the ' . substr($title, 0, -5) . ' Documentation'
: 'Search ' . $title;
@endphp
<h1>{{ $searchTitle }}</h1>
<style>#search-menu-button, .edit-page-link {
display: none !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct()
'title' => 'Search',
'navigation' => ['hidden' => true],
'article' => false,
], view: 'hyde::pages.documentation-search');
], view: 'hyde::pages.docs.search');
}

public static function enabled(): bool
Expand Down
20 changes: 19 additions & 1 deletion packages/framework/tests/Feature/DocumentationSearchPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function testCanRenderSearchPage()
$page = new DocumentationSearchPage();

Hyde::shareViewData($page);
$this->assertStringContainsString('<h1>Search the documentation site</h1>', $page->compile());
$this->assertStringContainsString('<h1>Search the HydePHP Documentation</h1>', $page->compile());
}

public function testRenderedSearchPageUsesDocumentationPageLayout()
Expand All @@ -106,4 +106,22 @@ public function testRenderedSearchPageDoesNotUseSemanticDocumentationMarkup()
$this->assertStringNotContainsString('<section id="document-main-content"', $html);
$this->assertStringNotContainsString('<footer id="document-footer"', $html);
}

public function testRenderedSearchPageUsesCustomSidebarHeader()
{
config(['docs.sidebar.header' => 'My Project']);
$page = new DocumentationSearchPage();

Hyde::shareViewData($page);
$this->assertStringContainsString('<h1>Search My Project</h1>', $page->compile());
}

public function testRenderedSearchPageExpandsDocsInSidebarHeader()
{
config(['docs.sidebar.header' => 'Custom Docs']);
$page = new DocumentationSearchPage();

Hyde::shareViewData($page);
$this->assertStringContainsString('<h1>Search the Custom Documentation</h1>', $page->compile());
}
}
8 changes: 4 additions & 4 deletions packages/hydefront/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/hydefront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/hydephp/hydefront#readme",
"devDependencies": {
"sass": "1.80.7"
"sass": "1.81.0"
},
"main": "dist/hyde.css"
}

0 comments on commit cd2a400

Please sign in to comment.