slint/docs/reference/_templates/searchbox.html
Aurindam Jana 3e96d0f930
Add Typesense Search (#6314)
Co-authored-by: aurindam <aurindam@users.noreply.github.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2024-09-27 20:18:41 +02:00

18 lines
562 B
HTML

{%- if 'singlehtml' not in builder %}
<div id="searchbar"></div>
<script src="https://cdn.jsdelivr.net/npm/typesense-docsearch.js@3.4"></script>
<script>
docsearch({
container: '#searchbar',
typesenseCollectionName: '$TYPESENSE_INDEX_NAME',
typesenseServerConfig: {
nodes: [{
host: '$TYPESENSE_SERVER_URL',
port: '$TYPESENSE_SERVER_PORT',
protocol: '$TYPESENSE_SERVER_PROTOCOL'
}],
apiKey: '$TYPESENSE_SEARCH_API_KEY',
}
});
</script>
{%- endif %}