Skip to content

Commit 9502da9

Browse files
Add traditional search button to home page banner
- Add dedicated search button next to chat entry field on home page - Maintains existing chat functionality while providing traditional search access - Button opens existing search modal with full documentation search capabilities - Styled consistently with chat form (white border, dark background, hover effects) - Includes tooltip showing keyboard shortcut (Ctrl+K) - Updated search modal click handler to support new button - Provides clear distinction between AI chat and traditional search options - Leverages existing search infrastructure and keyboard shortcuts This enhancement gives users immediate access to both AI-powered chat and traditional documentation search directly from the home page, improving discoverability and user experience.
1 parent 1162d32 commit 9502da9

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

layouts/home.html

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@ <h1 class="text-5xl font-medium">{{ .Title }}</h1>
1616
{{ with .Params.description }}
1717
<p class="text-xl md:text-2xl">{{ . | markdownify }}</p>
1818
{{ end }}
19-
<form class="flex flex-row items-center border border-white rounded-md px-6 gap-6 w-full md:w-4/5 bg-redis-ink-900" action="/chat">
20-
<label class="" for="search-home" id="search-label-home">
19+
<div class="flex flex-row items-center gap-4 w-full md:w-4/5">
20+
<form class="flex flex-row items-center border border-white rounded-md px-6 gap-6 w-full bg-redis-ink-900" action="/chat">
21+
<label class="" for="search-home" id="search-label-home">
22+
{{ partial "icons/search.html" }}
23+
</label>
24+
<input id="seach-home" name="q" class="appearance-none bg-transparent text-base sm:text-lg text-white placeholder-white w-full h-16 focus:outline-none"
25+
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
26+
placeholder="Ask our AI-powered Redis copilot a question…" maxlength="500" type="text" value="" tabindex=""/>
27+
<!--<input type="submit" class="hover:text-redis-pen-300" value="&#x23CE;"/>-->
28+
<input class="invisible" type="submit" class="hover:text-redis-pen-300" value=""/>
29+
</form>
30+
<button id="search-button-home" type="button" class="flex-shrink-0 p-3 border border-white rounded-md bg-redis-ink-900 hover:bg-white hover:text-redis-ink-900 transition-colors" title="Search documentation (Ctrl+K)">
2131
{{ partial "icons/search.html" }}
22-
</label>
23-
<input id="seach-home" name="q" class="appearance-none bg-transparent text-base sm:text-lg text-white placeholder-white w-full h-16 focus:outline-none"
24-
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
25-
placeholder="Ask our AI-powered Redis copilot a question…" maxlength="500" type="text" value="" tabindex=""/>
26-
<!--<input type="submit" class="hover:text-redis-pen-300" value="&#x23CE;"/>-->
27-
<input class="invisible" type="submit" class="hover:text-redis-pen-300" value=""/>
28-
</form>
32+
</button>
33+
</div>
2934
</div>
3035
</header>
3136
{{ partial "second-header.html" "disabled" }}

layouts/partials/search-modal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369

370370
// Click handler function
371371
function clickHandler(event) {
372-
if (event.target.closest('#search-button')) {
372+
if (event.target.closest('#search-button') || event.target.closest('#search-button-home')) {
373373
startSearch()
374374
} else if (event.target.closest('#search-cancel') || event.target.matches('#search-container')) {
375375
stopSearch()

0 commit comments

Comments
 (0)