jekyll-lunr-js-search
jekyll-lunr-js-search copied to clipboard
can you provide a sample jekyll site with lunr search integrated?
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.
I saved my integration here. Hope this helps.
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.
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?
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 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 where should I push the search index to? Could you tell me how to config it ?
@slashdotdash Thanks for your advice. I push the search.index to github.page . It works now