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
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
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)
Comments
Post a Comment