Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 7fc294b

Browse files
committed
Add search to the commands and topics
1 parent cc5ecff commit 7fc294b

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

public/styles.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,3 +329,9 @@ body { width: 100%; height: 100%; }
329329
.mobile-menu .menu-section-list a { display: block; padding: 10px 20px; }
330330
.mobile-menu .menu-section-list a:hover { background-color: rgba(255, 255, 255, 0.1); text-decoration: none; }
331331
.mobile-menu .logo { width: 120px; height: 106px; }
332+
333+
334+
#search { margin: 0 auto; background-color: #f0f0f0; width: 100%; font-size: 0.85em; display: block; padding: 10px 0; text-align: center;}
335+
#search .algolia-autocomplete { width: 600px; margin: 0 auto; }
336+
#search .search-bar { border-radius: 5px; padding: 5px 5px 6px 5px; width: 100%;}
337+
#search .search-bar:focus { outline: none; }

views/layout.haml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
%meta(charset="utf-8")
66
%title= [@title, "Redis"].compact.join("")
77
%link(rel="stylesheet" href="/styles.css")
8+
%link(rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css")
89
%link(rel="shortcut icon" href="/images/favicon.png")
910
%link(rel="search" type="application/opensearchdescription+xml" title="Look up a Redis command" href="/opensearch.xml")
1011
%meta(name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0")
@@ -69,6 +70,10 @@
6970
%aside.wide-callout
7071
.container
7172
<a href="http://redisconf.com">RedisConf 2018 is near!</a> Join us in San Francisco, April 24 - 26 at Pier 27. <a href="http://redisconf.com">NEW: use the code RCredisio for 75% discount</a>.
73+
74+
%section#search
75+
.container
76+
%input.search-bar(placeholder="Search for any command or topic")
7277

7378
= content
7479

@@ -86,3 +91,12 @@
8691

8792
%script(src="https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js")
8893
%script(src="/app.js?#{File.mtime("public/app.js").to_i}")
94+
%script(src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js")
95+
:javascript
96+
docsearch({
97+
appId: 'SQLJNQ4TNW',
98+
apiKey: '102a9f557f6dbbf7f3cc6755f8f4b7b1',
99+
indexName: 'redis',
100+
inputSelector: '#search .search-bar',
101+
debug: true
102+
});

0 commit comments

Comments
 (0)