Skip to content

Commit

Permalink
Add Algolia docsearch bar on the breadcumb (fastlane#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
spinach authored and KrauseFx committed Oct 4, 2017
1 parent fc36eea commit e3c85d4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
17 changes: 17 additions & 0 deletions docs/css/breadcrumbs.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

.wy-breadcrumbs li.wy-breadcrumbs-aside {
float: right;
padding-left: 20px;
}

.wy-breadcrumbs li.wy-breadcrumbs-aside input {
width: 250px;
}

.wy-breadcrumbs li a {
Expand All @@ -22,6 +27,18 @@
display: inline-block;
}

.wy-breadcrumbs input[type=text] {
width: 100%;
color: #333;
border-radius: 3px;
outline: 0;
padding: 10px;
height: 30px;
background-color: #fff;
border: solid 1px #6d6d6d;
box-shadow: none
}

@media screen and (max-width: 480px) {
.wy-breadcrumbs-extra {
display: none;
Expand Down
11 changes: 0 additions & 11 deletions docs/css/sidenav.css
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,6 @@
margin-bottom: .809em
}

.wy-side-nav-search input[type=text] {
width: 100%;
color: #333;
border-radius: 3px;
outline: 0;
padding: 10px;
background-color: #fff;
border: solid 1px #6d6d6d;
box-shadow: none
}

.wy-side-nav-search img {
display: block;
margin: auto auto .809em;
Expand Down
14 changes: 14 additions & 0 deletions theme/breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@
{% endif %}
</li>
{% endif %}
<li class="wy-breadcrumbs-aside">
<input type="text" name="q" placeholder="Search docs" />
</li>
</ul>
<hr/>
</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
<!-- at the end of the BODY -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
apiKey: 'c651753b86f5f8a00f8f2e9e9ca95865',
indexName: 'fastlane',
inputSelector: 'body > div.wy-grid-for-nav > section > div > div > div:nth-child(1) > ul > li.wy-breadcrumbs-aside > input[type="text"]',
debug: false
});
</script>
Empty file added theme/searchbox.html
Empty file.

0 comments on commit e3c85d4

Please sign in to comment.