algoliasearch-netlify
algoliasearch-netlify
is the front-end bundle we recommend to use with our Netlify plugin.
It's designed to be compatible with the index structure extracted by the plugin.
Usage
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@algolia/algoliasearch-netlify@0/dist/algoliasearchNetlify.css" />
<script type="text/javascript" href="https://cdn.jsdelivr.net/npm/@algolia/algoliasearch-netlify@0/dist/algoliasearchNetlify.js"></script>
<script type="text/javascript">
algoliasearchNetlify({
appId: '<YOUR_ALGOLIA_APP_ID>',
apiKey: '<YOUR_ALGOLIA_API_KEY>',
indexName: 'netlify_<YOUR_NETLIFY_SITE_ID>_<YOUR_BRANCH>',
});
</script>
Scripts
yarn dev
: run dev environmentyarn release
: build & publish the library
Available options
Here's the full list of options with their default value.
algoliasearchNetlify({
appId: '<YOUR_ALGOLIA_APP_ID>',
apiKey: '<YOUR_ALGOLIA_API_KEY>',
indexName: 'netlify_<YOUR_NETLIFY_SITE_ID>_<YOUR_BRANCH>',
analytics: true,
autocomplete: {
hitsPerPage: 5,
inputSelector: 'input[type=search]',
},
color: '#3c4fe0',
debug: false,
poweredBy: true,
});
Development
yarn dev
This runs a webpack-dev-server
on port 9100.
Meant to be used in conjunction with the test website.
Releasing