artsy / palette

Artsy's design system
https://palette-storybook.artsy.net/
MIT License
214 stars 45 forks source link

Implement Algolia Search #633

Open damassi opened 4 years ago

damassi commented 4 years ago

From Algolia customer support:


Congratulations, your search is now ready! I've successfully configured the underlying crawler and it will now run every 24h.

You're now a few steps away from having it working on your website:

<!-- at the end of the BODY -->
<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: 'e4ea4437446d07b0549e0db7928d92d1',
indexName: 'artsy_palette',
inputSelector: '### REPLACE ME ####',
debug: false // Set debug to true if you want to inspect the dropdown
});
</script>

Please open a pull request if want to leverage your configuration!

Feel free to get back to us if you have any issues or questions regarding the integration.

We'd also be happy to get your feedback and thoughts about DocSearch - so we can continue to improve it.

Have a nice day :)


@zephraph - would you mind logging into Algolia admin with your email (per the above) and updating to artsy@it?

zephraph commented 4 years ago

@damassi, done.

pepopowitz commented 4 years ago

I started looking into this. I found a Gatsby plugin to wire it up for us. It works great on initial page load, but once you start clicking around to different routes, it loses the ability to search. I found an issue that is kind of similar, but slightly different..but it does have a lead that I'm planning on investigating today.

damassi commented 4 years ago

I believe this is tied to component organization in Palette, rather than the plugin; on route change the sidebar is re-rendered. Lets pair if there are any issues.