Add documentation search to the site

Signed-off-by: jonasrosland <jrosland@vmware.com>
pull/2367/head
jonasrosland 2020-03-26 10:01:18 -04:00
parent 4d49b5971c
commit ddbe4f666c
2 changed files with 18 additions and 2 deletions

View File

@ -5,5 +5,6 @@
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon"> <link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="/css/styles.css?{{site.time | date: '%s%N'}}"> <link rel="stylesheet" href="/css/styles.css?{{site.time | date: '%s%N'}}">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
{% seo %} {% seo %}
</head> </head>

View File

@ -27,8 +27,14 @@
<div class="container container-max"> <div class="container container-max">
<div class="row"> <div class="row">
<div class="col-md-3 toc"> <div class="col-md-3 toc">
{% include versions.html %} {% include versions.html %}
{% include nav.html %} <br />
<form class="d-flex align-items-center">
<span class="algolia-autocomplete" style="position: relative; display: inline-block; direction: ltr;">
<input type="search" class="form-control docsearch-input" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="false" aria-owns="algolia-autocomplete-listbox-0" dir="auto" style="position: relative; vertical-align: top;">
</span>
</form>
{% include nav.html %}
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
{% include version-warning.html %} {% include version-warning.html %}
@ -42,6 +48,15 @@
{% include footer.html %} {% include footer.html %}
</div> </div>
</div> </div>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
apiKey: '3d80f66bb5ecf85f8e2760caef383f24',
indexName: 'velero',
inputSelector: '.docsearch-input',
algoliaOptions: { 'facetFilters': ["version:{{ page.version }}"] },
debug: false // Set debug to true if you want to inspect the dropdown
});
</script>
</body> </body>
</html> </html>