jekyll-algolia 1.4.5 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25dcef305ae5defcbd052350a93537507a4423c4
|
4
|
+
data.tar.gz: 4abd3043c0e9193fc6909c5e9cf70b9f3e9bdf44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95ca76fff66cbc98d960236fce7badc45c09f27f466cf4a75e95bc92f36b339cab5a9954820c33b7b185100ba380eb2449a3097c76cc35fdebba9449e9cb2d7e
|
7
|
+
data.tar.gz: 83467fa8bf2c28a3cc86834b94748cae4d02d9f927965c37e96700940c79172f94f91eac1ccb3b78f0b3e839f9bd5e1cc412f2b30baee5f24028fdcefcec02f0
|
@@ -183,7 +183,7 @@ module Jekyll
|
|
183
183
|
# should not happen as we proactively check for record size before pushing
|
184
184
|
# them. If it still happens it means that the value set in max_record_size
|
185
185
|
# is not matching the value in the plan.
|
186
|
-
def self.record_too_big_api?(error,
|
186
|
+
def self.record_too_big_api?(error, _context = {})
|
187
187
|
details = error_hash(error.message)
|
188
188
|
return false if details == false
|
189
189
|
|
@@ -54,13 +54,20 @@ module Jekyll
|
|
54
54
|
#
|
55
55
|
# content - The HTML content to parse
|
56
56
|
def self.extract_raw_records(content)
|
57
|
-
AlgoliaHTMLExtractor.run(
|
57
|
+
records = AlgoliaHTMLExtractor.run(
|
58
58
|
content,
|
59
59
|
options: {
|
60
60
|
css_selector: Configurator.algolia('nodes_to_index'),
|
61
61
|
tags_to_exclude: 'script,style,iframe'
|
62
62
|
}
|
63
63
|
)
|
64
|
+
# We remove objectIDs, as the will be added at the very end, after all
|
65
|
+
# the hooks and shrinkage
|
66
|
+
records.each do |record|
|
67
|
+
record.delete(:objectID)
|
68
|
+
end
|
69
|
+
|
70
|
+
records
|
64
71
|
end
|
65
72
|
end
|
66
73
|
end
|
@@ -346,7 +346,7 @@ module Jekyll
|
|
346
346
|
# their dashboard
|
347
347
|
#
|
348
348
|
# When users change some settings in their dashboard, those settings might
|
349
|
-
# get overwritten by the
|
349
|
+
# get overwritten by the plugin. We can't prevent that, but we can warn
|
350
350
|
# them when we detect they changed something.
|
351
351
|
def self.warn_of_manual_dashboard_editing(changed_keys)
|
352
352
|
# Transform the hash into readable YAML
|
@@ -10,7 +10,7 @@ module Jekyll
|
|
10
10
|
# Public: Get the byte size of the object once converted to JSON
|
11
11
|
# - record: The record to estimate
|
12
12
|
def self.size(record)
|
13
|
-
record.to_json.
|
13
|
+
record.to_json.bytesize
|
14
14
|
end
|
15
15
|
|
16
16
|
# Public: Attempt to reduce the size of the record by reducing the size of
|
@@ -33,7 +33,7 @@ module Jekyll
|
|
33
33
|
record[:excerpt_html] = record[:excerpt_text]
|
34
34
|
return record if size(record) <= max_size
|
35
35
|
|
36
|
-
# We
|
36
|
+
# We half the excerpts
|
37
37
|
excerpt_words = record[:excerpt_text].split(/\s+/)
|
38
38
|
shortened_excerpt = excerpt_words[0...excerpt_words.size / 2].join(' ')
|
39
39
|
record[:excerpt_text] = shortened_excerpt
|