1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
<!DOCTYPE HTML>
<html lang="en">
<head>
<%= render '/head.*' %>
<link rel="canonical" href="<%= @config[:base_url] %>/search/">
<!-- instantsearch -->
<link rel="stylesheet" href="<%= @items['/assets/stylesheets/instantsearch.*'].path %>">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/instantsearch.js@2.5.0/dist/instantsearch-theme-algolia.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/instantsearch.js@2.5.0/dist/instantsearch.min.css">
<script src="https://cdn.jsdelivr.net/npm/instantsearch.js@2.5.0"></script>
<script src="https://cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
<!-- end of instantsearch -->
</head>
<body>
<%= render '/header_search_page.*' %>
<div class=wrapper>
<div id="doc-nav" class="doc-nav">
</div>
<div class="main class instantsearch-input">
<%= yield %>
<hr>
<div class="clear"></div>
</div>
<%= render '/footer.*' %>
<%= render '/analytics.*' %>
<%= render '/https_redirect.*' %>
<script type="text/javascript">
const search = instantsearch({
appId: 'BH4D9OD16A',
apiKey: 'ce1690e1421303458a1fcbea0cc4a927',
indexName: 'gitlab',
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,
},
loadingIndicator: true,
urlSync: true
});
search.addWidget(
instantsearch.widgets.searchBox({
container: '#search-input',
reset: true
})
);
search.addWidget(
instantsearch.widgets.refinementList({
container: '#refinement-list',
attributeName: 'tags',
sortBy: ["name:asc","isRefined"],
templates: {
header: 'Refine your search:'
}
})
);
search.addWidget(
instantsearch.widgets.infiniteHits({
container: '#hits',
templates: {
item: document.getElementById('hit-template').innerHTML,
empty: "We didn't find any results for the search <em>\"{{query}}\"</em>"
},
escapeHits: true,
showMoreLabel: "Load more results..."
})
);
search.addWidget(
instantsearch.widgets.stats({
container: '#stats',
templates: {
body: '<div class="stats">We found {{nbHits}} results, fetched in {{processingTimeMS}}ms.</div>'
}
})
);
search.start();
</script>
</body>
</html>
|