jekyll-algolia 1.4.10 → 1.7.1

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
  SHA256:
3
- metadata.gz: d92da50295b78c54cda28aa8dbbbffcd880ae83ec72b6ab368523bdb74a1ac1f
4
- data.tar.gz: 22eb73c56cc7b6608773bd1de59a503a529f9885843218dd98a32fe6818dc08a
3
+ metadata.gz: 1c7f25e93449e7de0ed0ca453837ee37d2ad17ce0910b058f55f278ebe7dca83
4
+ data.tar.gz: 7993b1bae0c39e33cb39638b7b6d258be8bb7ffa79f61e21817b701e7aa5256c
5
5
  SHA512:
6
- metadata.gz: d8f91afe26669de335280e65c2218b0c175809245aac172b190b63bb806b136981d1fde4b786a8720db902b7198a93ec2465e8e0516c5ad7c96847db438de289
7
- data.tar.gz: a2184dd323a2945aebc62fa2b1be5eb34e7c121ee0c0a865d9e51d131569bd56286df5feb52ec2ce685f0006f07914a370a5484abcf1ce0a6fb7c40c85f08cf1
6
+ metadata.gz: 6e2021dca64a85cfbc2496a4f1b88cd73ccdf1202bfb190edfdaabd27bcb503b52e063152409fee5c56edf9a243ef410a3be1469e128b356505081ed2bb6b11b
7
+ data.tar.gz: be2e802a61c162846d4eb8760239fed3767618391caff853a73f25a1f978acb5678ad394c3fe4f5c3ccac13d5d35ee63d0a267530da0228806de165e6c311fe4
data/README.md CHANGED
@@ -9,6 +9,8 @@
9
9
 
10
10
  Add fast and relevant search to your Jekyll site.
11
11
 
12
+ > While this plugin was created by Algolia, it is not an officially supported API client. It is possible that future major versions of Jekyll break compatibility, or require changes.
13
+
12
14
  ## Usage
13
15
 
14
16
  ```shell
@@ -112,7 +114,7 @@ plugins.
112
114
 
113
115
  [12]: https://community.algolia.com/instantsearch.js/
114
116
 
115
- [13]: https://www.algolia.com/press#resources
117
+ [13]: https://www.algolia.com/press/?section=brand-guidelines
116
118
 
117
119
  [14]: https://github.com/ayastreb/
118
120
 
@@ -103,7 +103,7 @@ module Jekyll
103
103
  # Returns the value of this option, or the default value
104
104
  def self.algolia(key)
105
105
  config = get('algolia') || {}
106
- value = config[key] || ALGOLIA_DEFAULTS[key]
106
+ value = config[key].nil? ? ALGOLIA_DEFAULTS[key] : config[key]
107
107
 
108
108
  # No value found but we have a method to define the default value
109
109
  if value.nil? && respond_to?("default_#{key}")
@@ -159,6 +159,8 @@ module Jekyll
159
159
  # This will be a merge of default settings and the one defined in the
160
160
  # _config.yml file
161
161
  def self.settings
162
+ return {} if algolia('settings') == false
163
+
162
164
  user_settings = algolia('settings') || {}
163
165
  ALGOLIA_DEFAULTS['settings'].merge(user_settings)
164
166
  end
@@ -255,10 +257,10 @@ module Jekyll
255
257
  # their values to nil values from here
256
258
  def self.disable_other_plugins(config)
257
259
  # Disable archive pages from jekyll-archives
258
- config['jekyll-archives'] = nil
260
+ config.delete('jekyll-archives')
259
261
 
260
262
  # Disable pagination from jekyll-paginate
261
- config['paginate'] = nil
263
+ config.delete('paginate')
262
264
 
263
265
  # Disable pagination for jekyll-paginate-v2
264
266
  config['pagination'] = {} unless config['pagination'].is_a?(Hash)
@@ -269,8 +271,8 @@ module Jekyll
269
271
  config['autopages']['enabled'] = false
270
272
 
271
273
  # Disable tags from jekyll-tagging
272
- config['tag_page_dir'] = nil
273
- config['tag_page_layout'] = nil
274
+ config.delete('tag_page_dir')
275
+ config.delete('tag_page_layout')
274
276
 
275
277
  config
276
278
  end
@@ -76,11 +76,9 @@ module Jekyll
76
76
  # pages. We don't want to index those.
77
77
  # Source: https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/
78
78
  #
79
- # rubocop:disable Naming/PredicateName
80
79
  def self.is_404?(file)
81
80
  ['404.md', '404.html'].include?(File.basename(file.path))
82
81
  end
83
- # rubocop:enable Naming/PredicateName
84
82
 
85
83
  # Public: Check if the file is redirect page
86
84
  #
@@ -258,8 +258,8 @@ module Jekyll
258
258
  ::Algolia.batch!(slice)
259
259
 
260
260
  progress_bar.increment if should_have_progress_bar
261
- rescue StandardError => error
262
- ErrorHandler.stop(error, operations: slice)
261
+ rescue StandardError => e
262
+ ErrorHandler.stop(e, operations: slice)
263
263
  end
264
264
  end
265
265
  end
@@ -296,6 +296,8 @@ module Jekyll
296
296
  # If the settingID are not matching, it means our config is different, so
297
297
  # we push it, overriding the settingID for next push.
298
298
  def self.update_settings
299
+ return if Configurator.settings.empty?
300
+
299
301
  current_remote_settings = remote_settings || {}
300
302
  remote_setting_id = current_remote_settings.dig('userData', 'settingID')
301
303
 
@@ -338,8 +340,8 @@ module Jekyll
338
340
  # rubocop:disable Naming/AccessorMethodName
339
341
  def self.set_settings(settings)
340
342
  index.set_settings!(settings)
341
- rescue StandardError => error
342
- ErrorHandler.stop(error, settings: settings)
343
+ rescue StandardError => e
344
+ ErrorHandler.stop(e, settings: settings)
343
345
  end
344
346
  # rubocop:enable Naming/AccessorMethodName
345
347
 
@@ -5,9 +5,10 @@ module Jekyll
5
5
  class Document
6
6
  # By default, Jekyll will set the current date (time of build) to any
7
7
  # collection item. This will break our diff algorithm, so we monkey patch
8
- # this call to return nil if no date is defined instead.
8
+ # this call to return nil if no date is defined and the file is not a
9
+ # draft instead.
9
10
  def date
10
- data['date'] || nil
11
+ data["date"] ||= (draft? ? source_file_mtime : nil)
11
12
  end
12
13
  end
13
14
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Algolia
5
- VERSION = '1.4.10'
5
+ VERSION = '1.7.1'
6
6
  end
7
7
  end
@@ -24,6 +24,13 @@ module Jekyll
24
24
  command.option 'force_settings',
25
25
  '--force-settings',
26
26
  'Force updating of the index settings'
27
+ command.option 'future',
28
+ '--future',
29
+ 'Index posts with a future date'
30
+ command.option 'show_drafts',
31
+ '--drafts',
32
+ '-D',
33
+ 'Index posts in the _drafts folder'
27
34
 
28
35
  command.action do |_, options|
29
36
  configuration = configuration_from_options(options)
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.10
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Carry
8
- autorequire:
8
+ - Sylvain Utard
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2018-12-19 00:00:00.000000000 Z
12
+ date: 2021-05-31 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: algolia_html_extractor
@@ -28,16 +29,16 @@ dependencies:
28
29
  name: algoliasearch
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
- - - '='
32
+ - - "~>"
32
33
  - !ruby/object:Gem::Version
33
- version: '1.24'
34
+ version: '1.26'
34
35
  type: :runtime
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
- - - '='
39
+ - - "~>"
39
40
  - !ruby/object:Gem::Version
40
- version: '1.24'
41
+ version: '1.26'
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: filesize
43
44
  requirement: !ruby/object:Gem::Requirement
@@ -56,16 +57,22 @@ dependencies:
56
57
  name: jekyll
57
58
  requirement: !ruby/object:Gem::Requirement
58
59
  requirements:
59
- - - "~>"
60
+ - - ">="
60
61
  - !ruby/object:Gem::Version
61
- version: '3.0'
62
+ version: '3.6'
63
+ - - "<"
64
+ - !ruby/object:Gem::Version
65
+ version: '5.0'
62
66
  type: :runtime
63
67
  prerelease: false
64
68
  version_requirements: !ruby/object:Gem::Requirement
65
69
  requirements:
66
- - - "~>"
70
+ - - ">="
67
71
  - !ruby/object:Gem::Version
68
- version: '3.0'
72
+ version: '3.6'
73
+ - - "<"
74
+ - !ruby/object:Gem::Version
75
+ version: '5.0'
69
76
  - !ruby/object:Gem::Dependency
70
77
  name: json
71
78
  requirement: !ruby/object:Gem::Requirement
@@ -277,7 +284,7 @@ dependencies:
277
284
  - !ruby/object:Gem::Version
278
285
  version: '0.10'
279
286
  description: Index all your content into Algolia by running `jekyll algolia`
280
- email: tim@pixelastic.com
287
+ email: support@algolia.com
281
288
  executables: []
282
289
  extensions: []
283
290
  extra_rdoc_files: []
@@ -318,7 +325,7 @@ homepage: https://github.com/algolia/jekyll-algolia
318
325
  licenses:
319
326
  - MIT
320
327
  metadata: {}
321
- post_install_message:
328
+ post_install_message:
322
329
  rdoc_options: []
323
330
  require_paths:
324
331
  - lib
@@ -333,9 +340,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
333
340
  - !ruby/object:Gem::Version
334
341
  version: '0'
335
342
  requirements: []
336
- rubyforge_project:
337
- rubygems_version: 2.7.7
338
- signing_key:
343
+ rubygems_version: 3.2.3
344
+ signing_key:
339
345
  specification_version: 4
340
346
  summary: Index your Jekyll content into Algolia
341
347
  test_files: []