jekyll-lunr-js-search-plusplus 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 318d8467c5b7e59ce23207980d0aacddbebb3ef9
4
- data.tar.gz: caa395e5a99ee3e6243b5b6715aa909bcacf18b8
3
+ metadata.gz: 3180dd8320960c789f27175efa43373471b86ac0
4
+ data.tar.gz: c479ac26eccb4d4f3b475394f9f9694b4f3b1f5d
5
5
  SHA512:
6
- metadata.gz: dca892d61d9cf48b208a8e7e51f8851d64f7de25e294514978ba8ebdd02f5139bb1272e479ce552701bf0f11449cdd16a05f6fbca20b9f12fb06db70fd9c793f
7
- data.tar.gz: 599b7448c47d1748c86f654b80dc848eee41fcc07be5077550e0b927cfc1c301f79beb86cfb6fd03e9f460d3843553b8687d6f0c47f59b4d828f68d9a7a958fe
6
+ metadata.gz: e82c1344420c195acc9809cdf97815dfa76ef2e7bb48c9b37ddde32255463790db2c923ec9795c3762deb5ae2a74e84921496d722445f9ce786fac419d236d4f
7
+ data.tar.gz: 536c70fec51e5e5f6762c27b89e821889ce8dee860f6d05c10980041999582cd0969e730b91ebe8e1704924d871cf87ffa7d865ad6f535a16d6d104c2b6670a3
@@ -37,7 +37,8 @@ module Jekyll
37
37
  # Index all pages except pages matching any value in config['lunr_excludes'] or with date['exclude_from_search']
38
38
  # The main content from each page is extracted and saved to disk as json
39
39
  def generate(site)
40
- search_json_location = File.expand_path("search/search.json", site.source)
40
+ search_json_location_source = File.expand_path("search/search.json", site.source)
41
+ search_json_location_dest = File.expand_path("search.json", site.dest)
41
42
 
42
43
  if @dev_mode && File.exist?(search_json_location)
43
44
  search_json = JSON.parse(File.open(search_json_location).read)
@@ -86,12 +87,15 @@ module Jekyll
86
87
  # Create destination directory if it doesn't exist yet. Otherwise, we cannot write our file there.
87
88
  Dir::mkdir(site.dest) unless File.directory?(site.dest)
88
89
 
89
- File.open(search_json_location, "w") do |file|
90
+ File.open(search_json_location_dest, "w") do |file|
90
91
  file.write(JSON.pretty_generate(json))
91
92
  end
92
93
 
93
- # Keep the search.json file from being cleaned by Jekyll
94
- site.static_files << SearchIndexFile.new(site, site.dest, "/", @filename)
94
+ if @dev_mode
95
+ File.open(search_json_location_source, "w") do |file|
96
+ file.write(JSON.pretty_generate(json))
97
+ end
98
+ end
95
99
  end
96
100
 
97
101
  private
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module LunrJsSearch
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-lunr-js-search-plusplus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian