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

can you provide a sample jekyll site with lunr search integrated?

Open tomjoht opened this issue 10 years ago • 7 comments

Can you create a sample jekyll site with a plain integration of lunr search using the pre-built plugin method rather than the rubygem installation method? I had a hard time following the instructions but feel if i had example code, I could figure it out. If I could download the sample site, that would be perfect.

tomjoht avatar Jan 31 '15 20:01 tomjoht

I saved my integration here. Hope this helps.

flohei avatar Jan 31 '15 20:01 flohei

Awesome! Thanks. This was really helpful. I plugged it into a vanilla jekyll site, added the search.min.js file, the plugin files, and it worked. Here's a sample working jekyll site in case anyone wants to download a working sample: sample jekyll site with lunr integrated.

tomjoht avatar Jan 31 '15 20:01 tomjoht

For some reason I'm getting a warning about the version when I build jekyll: warning: already initialized constant Jekyll::LunrJsSearch::VERSION. Here's the full context of the error:

    johnson-mbpr13:resolvev3 tjohnson$ jekyll serve
Configuration file: /Users/tjohnson/projects/resolvev3/_config.yml
/Users/tjohnson/projects/resolvev3/_plugins/jekyll_lunr_js_search/version.rb:3: warning: already initialized constant Jekyll::LunrJsSearch::VERSION
/Users/tjohnson/.rvm/gems/ruby-2.0.0-p481/gems/jekyll-lunr-js-search-0.2.1/lib/jekyll_lunr_js_search/version.rb:3: warning: previous definition of VERSION was here
            Source: /Users/tjohnson/projects/resolvev3
       Destination: /Users/tjohnson/projects/resolvev3/_site
      Generating...
              Lunr: Creating search index...
              Lunr: Index ready (lunr.js v0.4.5)
                    done.
 Auto-regeneration: enabled for '/Users/tjohnson/projects/resolvev3'
Configuration file: /Users/tjohnson/projects/resolvev3/_config.yml
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

The site still builds, but I'd like to resolve this error. Can you help?

tomjoht avatar Feb 01 '15 00:02 tomjoht

I found the sample code only worked locally with jekyll server command. when I upload the code to github. It can't work on github server. Did I do anything wrong

samuel1208 avatar Feb 15 '15 06:02 samuel1208

@samuel1208 Jekyll plugins don't work in Github so you cannot use this plugin for GitHub pages, unless you also push up the locally generated search index.

slashdotdash avatar Feb 16 '15 09:02 slashdotdash

@slashdotdash where should I push the search index to? Could you tell me how to config it ?

samuel1208 avatar Feb 17 '15 01:02 samuel1208

@slashdotdash Thanks for your advice. I push the search.index to github.page . It works now

samuel1208 avatar Feb 17 '15 01:02 samuel1208