jekyll-lunr-js-search
jekyll-lunr-js-search copied to clipboard
Instructions could use some more detail
I'm somewhat new to Jekyll and had trouble with the instructions. I think it would be better to clearly separate out the content into three distinct sections:
- Installing lunr search using the pre-built plugin method
- Installing lunr search using the rubygem method
- Building the plugin for development purposes
Some other questions I had:
- why wouldn't I want to use simple.min.js instead of integrating all the libraries directly? the instructions seemed to minimize that option, adding it almost as a footnote.
- what is a search nominated page? can i just integrate it into the header of my default layout?
- where does the mustache template go?
- is jquery.lunr.search.js included in simple.min.js or separate?
I would be happy to help revise the instructions to make them clearer, especially providing an instruction from a viewpoint of someone who is more new to Jekyll, but I can't get the plugin working myself. Can you help me?
Yes, where does the mustache template go?
++1
"Place build/jekyll_lunr_js_search.rb inside the _plugins folder in the root of your Jekyll site"
umm... where is the "build" directory???? I searched my system and cannot find it.
In _plugins Am I putting a link there? Am I coping the file there?
There are new instructions for using this plugin on jekyll.tips. I haven't tried them out yet, though.
Sent from my iPhone
On Jun 14, 2015, at 10:46 AM, Dan Stroot [email protected] wrote:
++1
"Place build/jekyll_lunr_js_search.rb inside the _plugins folder in the root of your Jekyll site"
umm... where is the "build" directory???? I searched my system and cannot find it. Am I putting a link there? Am I coping the file there?
— Reply to this email directly or view it on GitHub.
"Place build/jekyll_lunr_js_search.rb inside the _plugins folder in the root of your Jekyll site"
I think this is referring to build/jekyll_lunr_js_search.rb in this repo, however, I'm not sure why you would want to install it this way instead of using the gem. This project has some other ruby dependencies, so there probably needs to be a disclaimer about needing them, or else installing locally in your _plugins dir won't work.
@ccsastro drop the mustache template inside the search-results element.
I created an _include called search.html, dropped this inside it and the form code, then added an <% include search.html %> tag in my default.html template (global search), where I wanted my search box to be displayed.
<section id="search-results" style="display: none;">
{% raw %}
<script id="search-results-template" type="text/mustache">
{{#entries}}
<article>
<h3>
{{#date}}<small><time datetime="{{pubdate}}" pubdate>{{displaydate}}</time></small>{{/date}}
<a href="{{url}}">{{title}}</a>
</h3>
{{#is_post}}
<ul>
{{#tags}}<li>{{.}} </li>{{/tags}}
</ul>
{{/is_post}}
</article>
{{/entries}}
</script>
{% endraw %}
</section>