Last active
November 17, 2017 05:12
-
-
Save manbearwolf/f86195a237ba5d8f5d5f67e147acdbe1 to your computer and use it in GitHub Desktop.
Simple Jekyll Search Bar (https://github.com/christian-fei/Simple-Jekyll-Search)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Html Elements for Search --> | |
| <div id="search-container"> | |
| <input type="text" id="search-input" placeholder="search..."> | |
| <ul id="results-container"></ul> | |
| </div> | |
| <!-- Script pointing to search-script.js or search-script.min.js https://github.com/christian-fei/Simple-Jekyll-Search/tree/master/dest or in header--> | |
| <script src="{{ site.baseurl }}/js/simple-jekyll-search.min.js" type="text/javascript"></script> | |
| <!-- Configuration & Options https://github.com/christian-fei/Simple-Jekyll-Search#configuration in the default layout | |
| or $(document).ready() (Personally one page load would be best, like tutorial, otherwise Chrome errors a lot (developer mode)....)--> | |
| <!-- Configuration --> | |
| <script> | |
| SimpleJekyllSearch({ | |
| searchInput: document.getElementById('search-input'), | |
| resultsContainer: document.getElementById('results-container'), | |
| json: '{{ site.baseurl }}/search.json' | |
| <!-- Extra Options --> | |
| noResultsText: 'No results found', | |
| limit: 10, | |
| fuzzy: false | |
| }) | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| layout: null | |
| --- | |
| [ | |
| {% for post in site.posts %} | |
| { | |
| "title" : "{{ post.title | escape }}", | |
| "url" : "{{ site.baseurl }}{{ post.url }}", | |
| "tags" : "{{ post.tags | join: ', ' }}", | |
| "date" : "{{ post.date }}" | |
| } {% unless forloop.last %},{% endunless %} | |
| {% endfor %} | |
| ] |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
one page load (Exactly like this... on one page)(chrome errors...development mode show up if in javascript)