Jekyll istant search -


i’m trying implement jekyll instant search /simple-jekyll-search found on github (sorry can't post more 2 link @ moment)

i followed steps, can see in _site search.json file, built correctly , being formatted.

but no results output in live site.

i have tried add search code in _layout: default.html, , using dedicated search.html page

--- layout: page title: search ---  <script src="{{ site.baseurl }}/search-script.js" type="text/javascript"></script>  <!-- configuration --> <script> simplejekyllsearch({   searchinput: document.getelementbyid('search-input'),   resultscontainer: document.getelementbyid('results-container'),   json: '/search.json' }) </script>   <!-- html elements search --> <div id="search-container"> <input type="text" id="search-input" placeholder="search..."> <ul id="results-container"></ul> </div> 

inspect console shows this

js error

enter image description here

while doing test, worked while, i’m not able reproduce conditions.

i think make mistakes in structure of pages , js not correctly being called

i have testsite here

realware

i'm quite sure i'm doing wrong in templating

thanks help

solved:

for future reference: minified version contains errors, found forked repo rebuilt version of js, remove big comment block in end of file because links external resources not needed , work charm

use repo, (not minified versions)

https://github.com/tigerhawkvok/simple-jekyll-search


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -