Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarek Ostrowski <jarek.j.ostrowski@gmail.com>2018-05-15 19:48:22 +0300
committerJarek Ostrowski <jarek.j.ostrowski@gmail.com>2018-05-15 19:48:22 +0300
commit20db3c965d3d27860bfbbb48f6be540b4badbc14 (patch)
tree3a1209c149c6e66108ff71b94ac266fbe56788d6 /layouts
parentad66411498c62e85d41f5ccb98433b4e7f093b45 (diff)
Fix mobile search results not showing up
Diffstat (limited to 'layouts')
-rw-r--r--layouts/docsearch.html15
-rw-r--r--layouts/header.html10
2 files changed, 21 insertions, 4 deletions
diff --git a/layouts/docsearch.html b/layouts/docsearch.html
index 72da891d..3b449fe3 100644
--- a/layouts/docsearch.html
+++ b/layouts/docsearch.html
@@ -16,4 +16,19 @@ var search = docsearch({
'autoselect': false
}
});
+var mobileSearch = docsearch({
+ apiKey: 'ce1690e1421303458a1fcbea0cc4a927',
+ indexName: 'gitlab',
+ inputSelector: '.docsearch-mobile',
+ algoliaOptions: {
+ // Filter by tags as described in https://github.com/algolia/docsearch-configs/blob/master/configs/gitlab.json
+ 'filters': "tags:gitlab OR tags:omnibus OR tags:runner",
+ // Number of results shown in the search dropdown
+ 'hitsPerPage': 10
+ },
+ debug: false, // Set debug to true if you want to inspect the dropdown
+ autocompleteOptions: {
+ 'autoselect': false
+ }
+});
</script>
diff --git a/layouts/header.html b/layouts/header.html
index af6252d8..57d45c51 100644
--- a/layouts/header.html
+++ b/layouts/header.html
@@ -17,10 +17,12 @@
</a>
<ul class="nav">
<% unless @item.identifier.to_s.split('/')[1] == 'search' %>
- <form id="search-form" action="/search/" method="get">
- <input type="text" name="q" class="docsearch docsearch-mobile" placeholder="Search" required/>
- <input type="submit" style="visibility: hidden; position:absolute;" />
- </form>
+ <li class="nav-item">
+ <form id="mobile-search-form" action="/mobileSearch/" method="get">
+ <input type="text" name="q" class="docsearch docsearch-mobile" placeholder="Search" required/>
+ <input type="submit" style="visibility: hidden; position:absolute;" />
+ </form>
+ </li>
<% end %>
<% if ENV['NANOC_ENV'] == 'production' %>
<% @config[:products].each do |name, product| %>