Skip to content
This repository was archived by the owner on Sep 18, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions build/jekyll_lunr_js_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def generate(site)
}

filepath = File.join(site.dest, filename)
File.open(filepath, "w") { |f| f.write(total.to_json) }
File.open(filepath, "w") { |f| f.write(JSON.dump(total)) }
Jekyll.logger.info "Lunr:", "Index ready (lunr.js v#{@lunr_version})"
added_files = [filename]

Expand Down Expand Up @@ -132,6 +132,21 @@ def pages_to_index(site)
end
end
end
module Jekyll
module LunrJsSearch
VERSION = "0.2.1"
end
end
module Jekyll
module LunrJsSearch
class SearchIndexFile < Jekyll::StaticFile
# Override write as the index.json index file has already been created
def write(dest)
true
end
end
end
end
require "v8"
require "json"

Expand All @@ -141,7 +156,7 @@ def to_json
end

def to_hash
JSON.parse(to_json)
JSON.parse(to_json, :max_nesting => false)
end
end
require 'nokogiri'
Expand Down Expand Up @@ -211,18 +226,3 @@ def strip_stopwords!(stopwords, min_length)
end
end
end
module Jekyll
module LunrJsSearch
class SearchIndexFile < Jekyll::StaticFile
# Override write as the index.json index file has already been created
def write(dest)
true
end
end
end
end
module Jekyll
module LunrJsSearch
VERSION = "0.2.1"
end
end
Loading