Skip to content

Commit

Permalink
Merge pull request #76 from algolia/fix/docsearch
Browse files Browse the repository at this point in the history
doc(search): fixed docsearch alignment + API key
  • Loading branch information
redox committed Mar 7, 2016
2 parents 7f472ba + e6c0b25 commit be259f4
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 43 deletions.
20 changes: 16 additions & 4 deletions docs/_includes/searchbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
</svg>

<form role="search" novalidate="novalidate" class="searchbox sbx-custom">
<input type="search" name="search" placeholder="Search in the documentation" autocomplete="off" required="required" class="sbx-custom__input">
<input onkeyup="updateReset()" type="search" name="search" placeholder="Search in the documentation" autocomplete="off" required="required" class="sbx-custom__input">
<button type="submit" class="sbx-custom__submit">
<svg role="img" aria-label="Search">
<title>Icon Search</title>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#sbx-icon-search-13"></use>
</svg>
</button>
<button type="reset" class="sbx-custom__reset">
<button type="reset" class="sbx-custom__reset hide">
<svg role="img" aria-label="Reset">
<title>Icon Reset</title>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#sbx-icon-clear-2"></use>
Expand All @@ -27,8 +27,20 @@
<script type="text/javascript">
//<![CDATA[
document.querySelector('.searchbox [type="reset"]').addEventListener('click', function() {
this.parentNode.querySelector('input').focus();
document.querySelector('.aa-input').focus();
this.className += " hide";
});

function updateReset() {
var searchbox = document.querySelector('.aa-input');
var reset = document.querySelector('.searchbox [type="reset"]');
reset.className = "";
reset.className = "sbx-custom__reset";
if (searchbox.value.length === 0){
reset.className += " hide";
}
}


//]]>
</script>
</script>
10 changes: 6 additions & 4 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@
<link rel="icon" href="{{ "/img/favicon.png" | prepend: site.baseurl }}">

<!-- Fonts -->
<link rel="stylesheet" media="screen" href="//fonts.googleapis.com/css?family=Raleway:300,800" />
<link rel="stylesheet" media="screen" href="//fonts.googleapis.com/css?family=Raleway:300,600" />
<link rel="stylesheet" media="screen" href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600" />

<link rel="stylesheet" media="screen" href="{{ "/css/main.css" | prepend: site.baseurl }}" />
<link rel="stylesheet" media="screen" href="//cdn.jsdelivr.net/fontawesome/4.4.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" />
</head>

<body>
Expand All @@ -64,9 +63,12 @@
<script type="text/javascript" src="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
<script type="text/javascript">
docsearch({
apiKey: 'd8dd0c4677c82b0164e6ac02d4807ba5',
apiKey: '25626fae796133dc1e734c6bcaaeac3c',
indexName: 'docsearch',
inputSelector: '.sbx-custom__input'
inputSelector: '.sbx-custom__input',
autocompleteOptions: {
debug: false
}
});
</script>

Expand Down
187 changes: 187 additions & 0 deletions docs/css/_docsearch.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
$color-border: #EEE;
$color-border-light: lighten($color-border, 15%);
$color-category-header-background: white;
$color-highlight-header-background: lighten($color-category-header-background, 15%);
$color-highlight-text: #0064E1;
$color-selected-background: rgba(#40ADDC,.07);
$color-selected-text: black;
$color-left-column-bg: white;
$color-left-column: #aaa;

$breakpoint-medium: 568px;
$breakpoint-large: 768px;

$dropdown-min-width-medium: 400px;
$dropdown-min-width-large: 600px;

// Main autocomplete wrapper
.aa-dropdown-menu {
background-color: #FFF;
border: 1px solid #333;
border-radius: 4px;
font-size: 16px;
padding: 4px;
text-align: left;
top: 38px !important;
margin-left: -$dropdown-min-width-medium !important;
}

// Each suggestion
.algolia-docsearch-suggestion {
color: #333;
cursor: pointer;
overflow: hidden;
}

// Each sub-suggestion
.algolia-docsearch-suggestion__secondary {
border-top: 1px solid $color-border;
}

// Main category headers
.algolia-docsearch-suggestion--category-header {
display: none;
border-bottom: solid 1px #ccc;
color: #40ADDC;
font-weight: 600;
padding: 5px 15px;
text-align: left;
font-size: 1.1em;
background-color: white;
// Only show it when flaggued as "__main"
.algolia-docsearch-suggestion__main & {
display: block;
}
}

// Highlight
.algolia-docsearch-suggestion--highlight {
padding: 0;
color: #40ADDC;
padding: 0 2px;
background: rgba(#40ADDC,.1);
// Highlight the background in header
.algolia-docsearch-suggestion--category-header & {
color: inherit;
background: $color-highlight-header-background;
}
}

// Selected suggestion
.aa-cursor .algolia-docsearch-suggestion--content {
color: $color-selected-text;
}
.aa-cursor .algolia-docsearch-suggestion {
background: $color-selected-background;
}

// The secondary column is hidden on small screens
.algolia-docsearch-suggestion--subcategory-column {
display: none;
cursor: default;
}
// The text snippet is hidden on small screens
.algolia-docsearch-suggestion--text {
display: none;
}

.algolia-docsearch-suggestion--content {
padding: 3px 5px;
width: 100%;
}

.algolia-docsearch-suggestion__main .algolia-docsearch-suggestion--content,
.algolia-docsearch-suggestion__secondary .algolia-docsearch-suggestion--content {
border-top: 0;
}

.algolia-docsearch-suggestion--subcategory-inline {
display: inline-block;
font-weight: 400;
&:after {
content: "";
}
}
.algolia-docsearch-suggestion--title {
display: inline;
font-weight: 600;
}

// Footer
.algolia-docsearch-footer {
border-top: 1px solid $color-border-light;
text-align: right;
font-size: 12px;
padding: 4px 2px 0 0;
color: #333;

.algolia-docsearch-footer--logo {
display: inline-block !important;
width: 45px;
height: 16px;
text-indent: 101%;
overflow: hidden;
white-space: nowrap;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAAAoCAYAAAA2cfJIAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAZYUlEQVR42uWceZxU1bXvv2ufc6qqa+iJHpihoRlkEFFAJQ5oBI04xTnxxvsEfZqYmMTc3JjEFzO/l7wkN/EakxuTe02ucQjGIWhExQAOKBEVFJC5GbqBBnquoWs4e70/quiuBoyA4PB5v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a291VgAAAABJRU5ErkJggg==');
background-repeat: no-repeat;
background-size: contain;
vertical-align: middle;
}
}

.aa-dropdown-menu {
min-width: $dropdown-min-width-large;
}
.algolia-docsearch-suggestion {
display: table;
width: 100%;
}

.algolia-docsearch-suggestion__secondary {
border-top: 1px solid $color-border-light;
}

.algolia-docsearch-suggestion--subcategory-column {
border-right: 1px solid $color-border-light;
background: transparent;
color: #999;
display: table-cell;
overflow: hidden;
padding: 5px 7px 5px 10px;
text-align: left;
font-size: 0.9em;
font-family: "Open Sans";
text-overflow: ellipsis;
vertical-align: top;
border-right: 1px solid #ccc;

width: 160px; // Hardcoded
max-width: 160px; // Hardcoded
min-width: 160px; // Hardcoded
}

.algolia-docsearch-suggestion--subcategory-column-text {
display: none;

.algolia-docsearch-suggestion__secondary & {
display: block;
}
}
.algolia-docsearch-suggestion--content {
display: table-cell;
padding: 5px 10px;
}
.algolia-docsearch-suggestion--subcategory-inline {
display: none;
}
.algolia-docsearch-suggestion--text {
display: block;
font-weight: 400;
font-family: "Open Sans";
font-size: .8em;
padding: 2px;
}

.algolia-docsearch-suggestion--wrapper {
margin: 10px;
}
51 changes: 21 additions & 30 deletions docs/css/_searchbar.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
$custom:(
input-width: 240px,
input-height: 36px,
border-width: 2px,
border-radius: 18px,
input-border-color: #1D96C7,
input-focus-border-color: #1D96C7,
input-background: #091724,
input-focus-background: #091724,
font-size: 13px,
placeholder-color: #AAAAAA,
icon: sbx-icon-search-13,
icon-size: 16px,
icon-position: left,
icon-color: #1D96C7,
icon-background: #FFFFFF,
icon-background-opacity: 0,
icon-clear: sbx-icon-clear-2,
icon-clear-size: 12px
input-width: 240px,
input-height: 36px,
border-width: 2px,
border-radius: 18px,
input-border-color: darken(#1D96C7,10%),
input-focus-border-color: #1D96C7,
input-background: #091724,
input-focus-background: #091724,
font-size: 13px,
placeholder-color: #AAAAAA,
icon-size: 16px,
icon-position: left,
icon-color: #1D96C7,
icon-background: #FFFFFF,
icon-background-opacity: 0,
icon-clear-size: 12px
);

@mixin searchbox(
Expand Down Expand Up @@ -130,7 +128,6 @@ $custom:(
}

&__reset {
display: none;
position: absolute;
top: ($input-height - $icon-clear-size) / 2 - 4px;
right: if($icon-position == 'right', 8px + $input-height, ($input-height - $icon-clear-size) / 2) - 4px;
Expand All @@ -140,7 +137,10 @@ $custom:(
cursor: pointer;
padding: 0;
user-select: none;
fill: rgba(#000, .5);

&.hide{
display: none;
}

&:focus {
outline: 0;
Expand All @@ -151,6 +151,7 @@ $custom:(
margin: 4px;
width: $icon-clear-size;
height: $icon-clear-size;
fill: $icon-color;
}
}

Expand Down Expand Up @@ -185,13 +186,3 @@ $custom:(
.algolia-autocomplete {
display: inline !important;
}

.aa-dropdown-menu.aa-with-0 {
top: 31px !important;
}

@media (min-width: 768px) {
.aa-dropdown-menu {
min-width: 530px !important;
}
}
1 change: 1 addition & 0 deletions docs/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
@import "home";
@import "page";
@import "searchbar";
@import "docsearch";
12 changes: 7 additions & 5 deletions docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ need to add the following code snippet to your website:
docsearch({
apiKey: '<API_KEY>',
indexName: '<INDEX_NAME>',
inputSelector: '<YOUR_INPUT_DOM_SELECTOR>'
inputSelector: '<YOUR_INPUT_DOM_SELECTOR>',
autocompleteOptions: {
debug: false
}
});
</script>
```
Expand Down Expand Up @@ -93,7 +96,7 @@ If you want to do heavily change the way results are displayed, you might find
it easier to directly edit the `scss` files in this repository.

[`_variables.scss`][18]
contains all the color, breakpoints and size definitions while
contains all the color, breakpoints and size definitions while
[`_main.scss`][19]
holds the structure of the display.

Expand All @@ -113,7 +116,7 @@ results from the Algolia API. As such, you can use any options provided by

You can pass any options to the underlying `autocomplete` instance through
the`autocompleteOptions` parameter. You will find all `autocomplete` options in
its [own documentation][22].
its [own documentation][22].

You can also listen to `autocomplete` events through the `.autocomplete`
property of the `docsearch` instance.
Expand Down Expand Up @@ -175,7 +178,7 @@ You will find all Algolia API options in its [own documentation][23]
[16]: https://community.algolia.com/docsearch/
[17]: https://community.algolia.com/docsearch/img/default-colorscheme.png
[18]: https://github.com/algolia/docsearch/blob/master/src/styles/_variables.scss
[19]: https://github.com/algolia/docsearch/blob/master/src/styles/_main.scss
[19]: https://github.com/algolia/docsearch/blob/master/src/styles/main.scss
[20]: https://github.com/algolia/autocomplete.js
[21]: https://github.com/algolia/autocomplete.js
[22]: https://github.com/algolia/autocomplete.js#options
Expand All @@ -184,4 +187,3 @@ You will find all Algolia API options in its [own documentation][23]
[25]: https://jekyllrb.com/
[26]: https://www.ruby-lang.org/en/
[27]: http://bundler.io/

0 comments on commit be259f4

Please sign in to comment.