jekyll-algolia 1.1.1 → 1.1.2

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: 145d078774c95a6e9dda69331854efa6fbc51672
4
- data.tar.gz: 34e00c41dee01556fe49811604a7819a3e4b252a
3
+ metadata.gz: 51f8221d0fd59da5c41a3a9dd8496dffd6562989
4
+ data.tar.gz: 56523270302c22f93d2537cfb8a614bf7c263cca
5
5
  SHA512:
6
- metadata.gz: 3a6d8b20abbeba1af7ee8de0bf8a111d41d40f6119caa156a1db433b1ca502cdff793cc8ffde2691fa60389b29b270f6fe4e2a3afb2294414d88de3c3c699af2
7
- data.tar.gz: 3bbcff1330a507c2f16a9c13f5f102741086bb34c362e71a746640f2ff55ec1f125985114bfe8598adb23f66c8ab71bb9de2e341168cb69c608242ae6e9e64d8
6
+ metadata.gz: 731e81066460aed7b1459a821f05ef7c4124a2b5cf0ae831bc3bc7cde7c29f9ede433e619a67e8dda111d7008b1bf0268af087cf57476ee2ab23d0e5c8c4c186
7
+ data.tar.gz: 15d46a745850b81fa7340fd319bd5eb31530457d890a616f8090da9c3fa0e60fccaa913246c6331ecbf00cdcf8c0482f4511cba425d05fbbc3282eba07e9effc
data/README.md CHANGED
@@ -1,10 +1,12 @@
1
1
  # Jekyll Algolia Plugin
2
2
 
3
- [![Gem Version][1]](http://badge.fury.io/rb/jekyll-algolia) [![Build
4
- Status][2]](https://travis-ci.org/algolia/jekyll-algolia) [![Coverage
5
- Status][3]](https://coveralls.io/github/algolia/jekyll-algolia?branch=master)
6
- [![Code Climate][4]](https://codeclimate.com/github/algolia/jekyll-algolia)
7
- ![Jekyll >= 3.6.0][5] ![Ruby >= 2.3.0][6]
3
+ [![gem version][1]](https://rubygems.org/gems/jekyll-algolia)
4
+ ![ruby][2]
5
+ ![jekyll][3]
6
+ [![build master][4]](https://travis-ci.org/algolia/jekyll-algolia)
7
+ [![coverage master][5]](https://coveralls.io/github/algolia/jekyll-algolia?branch=master)
8
+ [![build develop][6]](https://travis-ci.org/algolia/jekyll-algolia)
9
+ [![coverage develop][7]](https://coveralls.io/github/algolia/jekyll-algolia?branch=develop)
8
10
 
9
11
  Add fast and relevant search to your Jekyll site.
10
12
 
@@ -44,8 +46,8 @@ You need to provide certain Algolia credentials for this plugin to *index* your
44
46
  site.
45
47
 
46
48
  *If you don't yet have an Algolia account, you can open a free [Community plan
47
- here][7]. Once signed in, you can get your credentials from
48
- [your dashboard][8].*
49
+ here][8]. Once signed in, you can get your credentials from
50
+ [your dashboard][9].*
49
51
 
50
52
  Once you have your credentials, you should define your `application_id` and
51
53
  `index_name` inside your `_config.yml` file like this:
@@ -71,17 +73,18 @@ Note that `ALGOLIA_API_KEY` should be set to your admin API key.
71
73
 
72
74
  # Thanks
73
75
 
74
- Thanks to [Anatoliy Yastreb][9] for a [great tutorial][10] on creating Jekyll
76
+ Thanks to [Anatoliy Yastreb][10] for a [great tutorial][11] on creating Jekyll
75
77
  plugins.
76
78
 
77
79
 
78
80
  [1]: https://badge.fury.io/rb/jekyll-algolia.svg
79
- [2]: https://travis-ci.org/algolia/jekyll-algolia.svg?branch=master
80
- [3]: https://coveralls.io/repos/algolia/jekyll-algolia/badge.svg?branch=master&service=github
81
- [4]: https://codeclimate.com/github/algolia/jekyll-algolia/badges/gpa.svg
82
- [5]: https://img.shields.io/badge/jekyll-%3E%3D%203.6.0-green.svg
83
- [6]: https://img.shields.io/badge/ruby-%3E%3D%202.3.0-green.svg
84
- [7]: https://www.algolia.com/users/sign_up/hacker
85
- [8]: https://www.algolia.com/licensing
86
- [9]: https://github.com/ayastreb/
87
- [10]: https://ayastreb.me/writing-a-jekyll-plugin/
81
+ [2]: https://img.shields.io/badge/ruby-%3E%3D%202.3.0-green.svg
82
+ [3]: https://img.shields.io/badge/jekyll-%3E%3D%203.6.0-green.svg
83
+ [4]: https://img.shields.io/badge/dynamic/json.svg?label=build%3Amaster&query=value&uri=https%3A%2F%2Fimg.shields.io%2Ftravis%2Falgolia%2Fjekyll-algolia.json%3Fbranch%3Dmaster
84
+ [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
+ [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
+ [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
88
+ [9]: https://www.algolia.com/licensing
89
+ [10]: https://github.com/ayastreb/
90
+ [11]: https://ayastreb.me/writing-a-jekyll-plugin/
@@ -197,9 +197,17 @@ module Jekyll
197
197
  data.delete(key) if respond_to?(key)
198
198
  end
199
199
 
200
- # Also delete keys we manually handle
200
+ # Excerpt needs a special handling
201
201
  data.delete('excerpt')
202
202
 
203
+ # jekyll-asciidoc adds a document key to each page. Once converted to
204
+ # a string representation, it contains a random number, causing the
205
+ # object hash to change on each run. This causes the diff method to
206
+ # fail, so we discard this key.
207
+ if Utils.instance_of?(data['document'], 'Asciidoctor::Document')
208
+ data.delete('document')
209
+ end
210
+
203
211
  # Convert all keys to symbols
204
212
  data = Utils.keys_to_symbols(data)
205
213
 
@@ -26,6 +26,17 @@ module Jekyll
26
26
  Hash[hash.map { |key, value| [key.to_sym, value] }]
27
27
  end
28
28
 
29
+ # Public: Check if a variable is an instance of a specific class
30
+ #
31
+ # input - the variable to test
32
+ # classname - the string representation of the class
33
+ def self.instance_of?(input, classname)
34
+ return input.instance_of? Object.const_get(classname)
35
+ rescue StandardError
36
+ # The class might not even exist
37
+ return false
38
+ end
39
+
29
40
  # Public: Convert an HTML string to its content only
30
41
  #
31
42
  # html - String representation of the HTML node
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Algolia
5
- VERSION = '1.1.1'
5
+ VERSION = '1.1.2'
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.1.1
4
+ version: 1.1.2
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-02-14 00:00:00.000000000 Z
11
+ date: 2018-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: algolia_html_extractor