hyde icon indicating copy to clipboard operation
hyde copied to clipboard

Search on site

Open divush opened this issue 8 years ago • 1 comments

Typical blog site will have a lot of posts. I was wondering if it is possible to implement a search algorithm that allows the user to search for topics. I have already implemented a tagging system, but what if people want to search for a particular word or phrase, which is not a tag. Can this even be implemented in a static site?

divush avatar Jul 16 '17 13:07 divush

Hello @divush.

I'm the author of the jekyll-algolia plugin that does exactly what you're suggesting: adding search to a Jekyll website. It works by extracting all content from the posts/pages and pushing them to the Algolia API. You then trigger a search from the front-end by directly calling the Algolia API in JavaScript. You can check a live demo here if you're interested.

As a matter of fact, I'd be happy to submit a PR to add this plugin to the theme if the maintainers think it's worth it. Another theme (Minimal Mistakes) already implemented it (with a fallback to Lunr.js in case you don't want to use Algolia).

pixelastic avatar Mar 21 '18 12:03 pixelastic