christian-fei / Simple-Jekyll-Search

A JavaScript library to add search functionality to any Jekyll blog.
https://christian-fei.github.io/Simple-Jekyll-Search/
MIT License
1.34k stars 203 forks source link

Callback when search results are displayed #177

Closed jonaskohl closed 3 years ago

jonaskohl commented 3 years ago

It would be really nice if there was a callback/event which gets invoken when a search has completed and the search results (or no results) are displayed, e.g.:

var _sjs = SimpleJekyllSearch({
  searchInput: searchInput,
  resultsContainer: resultsContainer,
  json: '/search.json',
  onSearch: function() {} // <=== This is my suggestion
});
Mabbs commented 3 years ago

I think the templateMiddleware function can do the same

christian-fei commented 3 years ago

this should now be available through onSearch as suggested by @jonaskohl