jekyll-algolia 1.3.2 → 1.3.3

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: bf886389ae5ad938db693d1bc2ed35e2b89015d3
4
- data.tar.gz: 252509afafa7dd89faea1ed3dc7aa9590da1a9be
3
+ metadata.gz: 7d43c87fe0b5fbfc8fc82a37856b91b4d5afc302
4
+ data.tar.gz: bed79ab03a0debd6d942d32c6c0aa7b50736ecde
5
5
  SHA512:
6
- metadata.gz: 3a4472b586bbd24f67ee82c4e1bdb8505789d50296b5604b4be388fa25df123545c5e949b8e7caada3276e28a4f1a9f0270a0ae5013f08d1c47d17df0238fc27
7
- data.tar.gz: 78946a3ec46e391260479c1e2a24b131c3627d86f4b643f8e884b8cb183376317e95827600036b402c703ad2f796023d7f939777961ed809e70f40581b5f3221
6
+ metadata.gz: b4957ab0730f5955bdab4cf148021e5162973a844eb0f0c58fe0c1c7ac9dae5c89859995755f500ed7ccb10858b3c31020661c82c945e47f919135168811a6ef
7
+ data.tar.gz: 8f4d12ee5472aef456a02d5cfd84f85d8eb8466817880fbf644ad78f16621a85651e3acfefff951aa8b6ad1597830df5eb7975e64d7b4b98bde28a91aeae4df4
@@ -13,5 +13,5 @@ W:algolia:
13
13
  W:  settings:
14
14
  {settings}
15
15
  I:
16
- I:If you'd like to revert your index to its default settings, the best way is to delete the index and run `jekyll algolia` again.
16
+ I:If you'd like to revert to the default settings, the easiest way delete the indices and run `jekyll algolia` again.
17
17
  I:
@@ -1,9 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'jekyll/commands/algolia'
4
- require 'jekyll/algolia/overwrites/jekyll-algolia-site'
5
- require 'jekyll/algolia/overwrites/jekyll-document'
6
- require 'jekyll/algolia/overwrites/jekyll-tags-link'
7
4
  require 'date'
8
5
 
9
6
  module Jekyll
@@ -29,6 +26,9 @@ module Jekyll
29
26
  # The gist of the plugin works by instanciating a Jekyll site,
30
27
  # monkey-patching its `write` method and building it.
31
28
  def self.init(config = {})
29
+ # Monkey patch Jekyll and external plugins
30
+ load_overwrites
31
+
32
32
  config = Configurator.init(config).config
33
33
  @site = Jekyll::Algolia::Site.new(config)
34
34
 
@@ -36,9 +36,6 @@ module Jekyll
36
36
 
37
37
  Configurator.warn_of_deprecated_options
38
38
 
39
- # Register our own tags to overwrite the default tags
40
- Liquid::Template.register_tag('link', JekyllAlgoliaLink)
41
-
42
39
  if Configurator.dry_run?
43
40
  Logger.log('W:==== THIS IS A DRY RUN ====')
44
41
  Logger.log('W: - No records will be pushed to your index')
@@ -48,6 +45,21 @@ module Jekyll
48
45
  self
49
46
  end
50
47
 
48
+ # Public: Monkey patch Jekyll and external plugins so they don't interfere
49
+ # with our plugin
50
+ #
51
+ # Note: This is only loaded when running `jekyll algolia` so should not have
52
+ # any impact on regular builds
53
+ def self.load_overwrites
54
+ require 'jekyll/algolia/overwrites/githubpages-configuration'
55
+ require 'jekyll/algolia/overwrites/jekyll-algolia-site'
56
+ require 'jekyll/algolia/overwrites/jekyll-document'
57
+ require 'jekyll/algolia/overwrites/jekyll-tags-link'
58
+
59
+ # Register our own tags to overwrite the default tags
60
+ Liquid::Template.register_tag('link', JekyllAlgoliaLink)
61
+ end
62
+
51
63
  # Public: Run the main Algolia module
52
64
  #
53
65
  # Actually "process" the site, which will acts just like a regular `jekyll
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GitHubPages
4
+ # The github-pages gem will automatically disable every plugin that is not in
5
+ # the whitelist of plugins allowed by GitHub. This includes any plugin defined
6
+ # in the `_plugins` folder as well.
7
+ #
8
+ # Users of the jekyll-algolia plugin will use custom plugins in _plugins to
9
+ # define custom hooks to modify the indexing. If they happen to have the
10
+ # github-pages gem installed at the same time, those hooks will never be
11
+ # executed.
12
+ #
13
+ # Here, we overwrite the call to GitHubPages::Configuration.set that init the
14
+ # whole plugin to actually do nothing, hence disabling the plugin completely.
15
+ # https://github.com/github/pages-gem/blob/master/lib/github-pages.rb#L19
16
+ #
17
+ # This file will only be loaded when running `jekyll algolia`, so it won't
18
+ # interfere with the regular usage of `jekyll build`
19
+ class Configuration
20
+ class << self
21
+ def set(site); end
22
+ end
23
+ end
24
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Algolia
5
- VERSION = '1.3.2'
5
+ VERSION = '1.3.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Carry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-05 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: algolia_html_extractor
@@ -303,6 +303,7 @@ files:
303
303
  - lib/jekyll/algolia/hooks.rb
304
304
  - lib/jekyll/algolia/indexer.rb
305
305
  - lib/jekyll/algolia/logger.rb
306
+ - lib/jekyll/algolia/overwrites/githubpages-configuration.rb
306
307
  - lib/jekyll/algolia/overwrites/jekyll-algolia-site.rb
307
308
  - lib/jekyll/algolia/overwrites/jekyll-document.rb
308
309
  - lib/jekyll/algolia/overwrites/jekyll-tags-link.rb