Merge pull request #203 from pdmosses/search-config

Search config
This commit is contained in:
Patrick Marsceill
2019-09-09 16:00:11 -04:00
committed by GitHub
6 changed files with 24 additions and 6 deletions

View File

@@ -52,8 +52,13 @@ function initSearch() {
if (request.status >= 200 && request.status < 400) {
// Success!
var data = JSON.parse(request.responseText);
{% if site.search_tokenizer_separator != nil %}
lunr.tokenizer.separator = {{ site.search_tokenizer_separator }}
{% else %}
lunr.tokenizer.separator = /[\s\-/]+/
{% end %}
var index = lunr(function () {
this.ref('id');
this.field('title', { boost: 200 });