Skip to content

Commit cd2a400

Browse files
committed
Merge branch '2.x-dev' into new-asset-system
2 parents b418b52 + 24929b9 commit cd2a400

File tree

6 files changed

+35
-8
lines changed

6 files changed

+35
-8
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ This serves two purposes:
7676
- 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
7777
- Improved how the `MarkdownService` class is accessed, by binding it into the service container, in https://github.com/hydephp/develop/pull/1922
7878
- Improved the media asset transfer build task to have better output in https://github.com/hydephp/develop/pull/1904
79+
- 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
80+
- Moved Blade view `hyde::pages.documentation-search` to `hyde::pages.docs.search` in https://github.com/hydephp/develop/pull/2033
7981
- **Many MediaFile related helpers have been changed or completely rewritten** to provide a simplified API for interacting with media files.
8082
- **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.
8183
- 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.

packages/framework/resources/views/pages/documentation-search.blade.php renamed to packages/framework/resources/views/pages/docs/search.blade.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
@extends('hyde::layouts.docs')
22
@section('content')
3-
<h1>Search the documentation site</h1>
3+
@php
4+
$title = Config::getString('docs.sidebar.header', 'Documentation');
5+
6+
$searchTitle = str_ends_with(strtolower($title), ' docs')
7+
? 'Search the ' . substr($title, 0, -5) . ' Documentation'
8+
: 'Search ' . $title;
9+
@endphp
10+
<h1>{{ $searchTitle }}</h1>
411
<style>#search-menu-button, .edit-page-link {
512
display: none !important;
613
}

packages/framework/src/Framework/Features/Documentation/DocumentationSearchPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct()
2929
'title' => 'Search',
3030
'navigation' => ['hidden' => true],
3131
'article' => false,
32-
], view: 'hyde::pages.documentation-search');
32+
], view: 'hyde::pages.docs.search');
3333
}
3434

3535
public static function enabled(): bool

packages/framework/tests/Feature/DocumentationSearchPageTest.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function testCanRenderSearchPage()
8282
$page = new DocumentationSearchPage();
8383

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

8888
public function testRenderedSearchPageUsesDocumentationPageLayout()
@@ -106,4 +106,22 @@ public function testRenderedSearchPageDoesNotUseSemanticDocumentationMarkup()
106106
$this->assertStringNotContainsString('<section id="document-main-content"', $html);
107107
$this->assertStringNotContainsString('<footer id="document-footer"', $html);
108108
}
109+
110+
public function testRenderedSearchPageUsesCustomSidebarHeader()
111+
{
112+
config(['docs.sidebar.header' => 'My Project']);
113+
$page = new DocumentationSearchPage();
114+
115+
Hyde::shareViewData($page);
116+
$this->assertStringContainsString('<h1>Search My Project</h1>', $page->compile());
117+
}
118+
119+
public function testRenderedSearchPageExpandsDocsInSidebarHeader()
120+
{
121+
config(['docs.sidebar.header' => 'Custom Docs']);
122+
$page = new DocumentationSearchPage();
123+
124+
Hyde::shareViewData($page);
125+
$this->assertStringContainsString('<h1>Search the Custom Documentation</h1>', $page->compile());
126+
}
109127
}

packages/hydefront/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/hydefront/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"homepage": "https://github.com/hydephp/hydefront#readme",
2525
"devDependencies": {
26-
"sass": "1.80.7"
26+
"sass": "1.81.0"
2727
},
2828
"main": "dist/hyde.css"
2929
}

0 commit comments

Comments
 (0)