jekyll-algolia 1.1.3 → 1.1.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: a394d33bddf856fafbb84d345f2a87987583757b
4
- data.tar.gz: eaeaa8ff67fdfda25d94e312cdcc18d21510c9a5
3
+ metadata.gz: 5a91395a6d04dc0f9b9ef49da23e16bf1456969d
4
+ data.tar.gz: fbad45afa7727fc7029dc2806846f1cd4cb31cc7
5
5
  SHA512:
6
- metadata.gz: db3edbb0a108e58ceddc7c9c1b6aaafe9747d968b007e4b9a25c58ee7a878035282e8452ee826b57d26a503c247667fccdae991222ffc7d4aa28aa055876bb37
7
- data.tar.gz: 24f04bf128f70fe949f8bc27f59e3ac39cb172771dab6365205c0716cc92434e5e4d6d62f46b0c25368031db28d11944f9c065377ef1e92c6af11cf90e84e9c2
6
+ metadata.gz: c2330e69b46b065cff3c5c6398d1d7348bc076d2d3c79728f4be43212b009591eda19218f4f62f7b536a0ff9bf42692ec91bb63d3ccd2f671cf7a30b935d5e98
7
+ data.tar.gz: be599da416025ba2867b42817907b384f86be69ad4a951a4cecfd62e27ab5ac195b74fce69a8e3e736a0456f79b334fc6810d58e05b0711ddd392cd419f4af42
data/README.md CHANGED
@@ -46,8 +46,8 @@ You need to provide certain Algolia credentials for this plugin to *index* your
46
46
  site.
47
47
 
48
48
  *If you don't yet have an Algolia account, you can open a free [Community plan
49
- here][8]. Once signed in, you can get your credentials from
50
- [your dashboard][9].*
49
+ here][8]. Once signed in, you can get your
50
+ credentials from [your dashboard][9].*
51
51
 
52
52
  Once you have your credentials, you should define your `application_id` and
53
53
  `index_name` inside your `_config.yml` file like this:
@@ -71,9 +71,20 @@ ALGOLIA_API_KEY='{your_admin_api_key}' bundle exec jekyll algolia
71
71
 
72
72
  Note that `ALGOLIA_API_KEY` should be set to your admin API key.
73
73
 
74
+ ## More about the Community plan
75
+
76
+ The Algolia [Community plan][10] lets you host up to 10k records and perform up to
77
+ 100k add/edit/delete operations per month (search operations are free). The plan
78
+ is entirely free, with no time limit.
79
+
80
+ What we ask in exchange is that you display a "Search by Algolia" logo next to
81
+ your search results. Our [InstantSearch libraries][11] have a simple boolean
82
+ option to toggle that on an off. If you want more flexibility, you can find
83
+ all versions of our logo [here][12].
84
+
74
85
  # Thanks
75
86
 
76
- Thanks to [Anatoliy Yastreb][10] for a [great tutorial][11] on creating Jekyll
87
+ Thanks to [Anatoliy Yastreb][13] for a [great tutorial][14] on creating Jekyll
77
88
  plugins.
78
89
 
79
90
 
@@ -84,7 +95,10 @@ plugins.
84
95
  [5]: https://img.shields.io/badge/dynamic/json.svg?label=coverage%3Amaster&colorB=&prefix=&suffix=%25&query=$.coverage_change&uri=https%3A%2F%2Fcoveralls.io%2Fgithub%2Falgolia%2Fjekyll-algolia.json%3Fbranch%3Dmaster
85
96
  [6]: https://img.shields.io/badge/dynamic/json.svg?label=build%3Adevelop&query=value&uri=https%3A%2F%2Fimg.shields.io%2Ftravis%2Falgolia%2Fjekyll-algolia.json%3Fbranch%3Ddevelop
86
97
  [7]: https://img.shields.io/badge/dynamic/json.svg?label=coverage%3Adevelop&colorB=&prefix=&suffix=%25&query=$.coverage_change&uri=https%3A%2F%2Fcoveralls.io%2Fgithub%2Falgolia%2Fjekyll-algolia.json%3Fbranch%3Ddevelop
87
- [8]: https://www.algolia.com/users/sign_up/hacker
98
+ [8]: #more-about-the-community-plan
88
99
  [9]: https://www.algolia.com/licensing
89
- [10]: https://github.com/ayastreb/
90
- [11]: https://ayastreb.me/writing-a-jekyll-plugin/
100
+ [10]: https://www.algolia.com/users/sign_up/hacker
101
+ [11]: https://community.algolia.com/instantsearch.js/
102
+ [12]: https://www.algolia.com/press#resources
103
+ [13]: https://github.com/ayastreb/
104
+ [14]: https://ayastreb.me/writing-a-jekyll-plugin/
@@ -135,15 +135,19 @@ module Jekyll
135
135
  Logger.log("I:Records to add: #{new_records.length}")
136
136
  return if Configurator.dry_run?
137
137
 
138
- operations = new_records.map do |new_record|
139
- { action: 'addObject', indexName: index_name, body: new_record }
140
- end
138
+ # We group delete and add operations into the same batch. Delete
139
+ # operations should still come first, to avoid hitting an overquota too
140
+ # soon
141
+ operations = []
141
142
  old_records_ids.each do |object_id|
142
143
  operations << {
143
144
  action: 'deleteObject', indexName: index_name,
144
145
  body: { objectID: object_id }
145
146
  }
146
147
  end
148
+ operations += new_records.map do |new_record|
149
+ { action: 'addObject', indexName: index_name, body: new_record }
150
+ end
147
151
 
148
152
  # Run the batches in slices if they are too large
149
153
  batch_size = Configurator.algolia('indexing_batch_size')
@@ -104,6 +104,12 @@ module Jekyll
104
104
  Integer, Float,
105
105
  String
106
106
  ]
107
+ # Integer arrived in Ruby 2.4. Before that it was Fixnum and Bignum
108
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.4.0')
109
+ # rubocop:disable Lint/UnifiedInteger
110
+ simple_types += [Fixnum, Bignum]
111
+ # rubocop:enable Lint/UnifiedInteger
112
+ end
107
113
  return item if simple_types.member?(item.class)
108
114
 
109
115
  # Recursive types
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Algolia
5
- VERSION = '1.1.3'
5
+ VERSION = '1.1.4'
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.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Carry