jekyll-lunr-js-search icon indicating copy to clipboard operation
jekyll-lunr-js-search copied to clipboard

Instructions could use some more detail

Open tomjoht opened this issue 10 years ago • 5 comments

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?

tomjoht avatar Jan 31 '15 20:01 tomjoht

Yes, where does the mustache template go?

ccsastro avatar May 06 '15 15:05 ccsastro

++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?

dstroot avatar Jun 14 '15 17:06 dstroot

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.

tomjoht avatar Jun 14 '15 18:06 tomjoht

"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.

dagoss avatar Aug 17 '15 19:08 dagoss

@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>

soulpimp avatar Apr 20 '16 14:04 soulpimp