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 +4 -4
- data/lib/jekyll_lunr_js_search/indexer.rb +8 -4
- data/lib/jekyll_lunr_js_search/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3180dd8320960c789f27175efa43373471b86ac0
|
|
4
|
+
data.tar.gz: c479ac26eccb4d4f3b475394f9f9694b4f3b1f5d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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(
|
|
90
|
+
File.open(search_json_location_dest, "w") do |file|
|
|
90
91
|
file.write(JSON.pretty_generate(json))
|
|
91
92
|
end
|
|
92
93
|
|
|
93
|
-
|
|
94
|
-
|
|
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
|