mirror of
https://github.com/kubesphere/website.git
synced 2025-12-26 00:12:48 +00:00
32 lines
1010 B
HTML
32 lines
1010 B
HTML
<div class="search-input-div">
|
|
<input id="search" type="text" placeholder="{{i18n "Search Documentation"}}">
|
|
<svg width="1em" height="1em" viewBox="0 0 18 18">
|
|
<g fill="none" fill-rule="evenodd">
|
|
<path d="M12.606 11.192l5.24 5.24-1.415 1.414-5.239-5.24a7.041 7.041 0 0 0 1.414-1.414z" fill="#324558"></path>
|
|
<path d="M7 14A7 7 0 1 1 7 0a7 7 0 0 1 0 14zm0-2A5 5 0 1 0 7 2a5 5 0 0 0 0 10z" fill="#B6C2CD"></path>
|
|
</g>
|
|
</svg>
|
|
</div>
|
|
<script>
|
|
docsearch({
|
|
apiKey: '221332a85783d16a5b930969fe4a934a',
|
|
indexName: 'kubesphere',
|
|
inputSelector: '#search',
|
|
algoliaOptions: {
|
|
facetFilters: [`lang:${language}`],
|
|
},
|
|
transformData: function(hits) {
|
|
hits.forEach(hit => {
|
|
if (typeof window !== undefined) {
|
|
var host = window.location.host
|
|
if (host == 'kubesphere.com.cn' && language == 'en') {
|
|
host = host + '/en'
|
|
}
|
|
hit.url = hit.url.replace('kubesphere.io', host)
|
|
}
|
|
})
|
|
return hits
|
|
},
|
|
debug: false,
|
|
})
|
|
</script> |