How to add a search bar?


#1

How we can add a search bar in Jekyll website.


#2

See these tutorials on search from CloudCannon: https://learn.cloudcannon.com/jekyll-search/


#3

Here is an example of a super simple site-search (using Google):

<form method="get" action="http://www.google.com/search" target="_blank">
<input type="hidden" name="sitesearch" value="ibkc-carrosserie.nl" />
<input type="text" name="q" maxlength="255" placeholder="Search with Google" />
</form>

Note that the domainname needs to be changed (currently ‘ibkc-carrosserie.nl’). See the full code at: https://github.com/jhvanderschee/oocinfo/blob/master/_includes/footer.html. The live website can be found here: http://ibkc-carrosserie.nl/.


#4

You can use a Javascript search like lunr.


#5

i have made a search feature for a Jekyll shop. using this method shown here

http://kushagragour.in/blog/2015/06/search-in-jekyll-blog/


#6

So, if we add the search bar on what basis it will show the search results?

On the basis of category or tags or keyword?


#7

On build it will build an xml file to search… I used a bit of ymal call search terms


#8

I have tried to add the search bar. But it didn’t go well.

Is there any other option?


#9

Have you looked into Algolia?

There’s a Jekyll plugin to auto-sync data from a standard Jekyll blog (link).

If you’re doing more than a blog, a quick search on Github will pull up a number of results (including a few I’ve made over the years). I’d recommend starting with their instantsearch library.