slashdotdash / jekyll-lunr-js-search

[UNSUPPORTED] Jekyll + lunr.js = static websites with powerful full-text search using JavaScript
MIT License
548 stars 108 forks source link

Instructions could use some more detail #62

Open tomjoht opened 9 years ago

tomjoht commented 9 years ago

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:

Some other questions I had:

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?

ccsastro commented 9 years ago

Yes, where does the mustache template go?

dstroot commented 9 years ago

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

tomjoht commented 9 years ago

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 notifications@github.com 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.

dagoss commented 9 years ago

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

soulpimp commented 8 years ago

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