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: 595e82b7237d2e00b49d8a147aca13bde1615582
4
- data.tar.gz: e2ac1d6b57b35e42ff4815ba17555d6a14e8ab65
3
+ metadata.gz: 25dcef305ae5defcbd052350a93537507a4423c4
4
+ data.tar.gz: 4abd3043c0e9193fc6909c5e9cf70b9f3e9bdf44
5
5
  SHA512:
6
- metadata.gz: 69597c2b471dff59c642a89b9a63ba4d65fe8ff2eb572f309efc4298d2c546dc21e0f9144f3d3861574f1afc3db9d313718599cd9d1f1615710464f1db7090ec
7
- data.tar.gz: da920a83407508c62b1b0747ea6b1b29e156fcb4fce3aa3241198fd0556054a298fedab168a973bbc6262eacff7be9e805282b2cd01e152f93892164dd3d1000
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, _contex = {})
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 pluging. We can't prevent that, but we can warn
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.length
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 halve the excerpts
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Algolia
5
- VERSION = '1.4.5'
5
+ VERSION = '1.4.6'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Carry