jekyll-algolia 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -17
- data/lib/jekyll/algolia/file_browser.rb +9 -1
- data/lib/jekyll/algolia/utils.rb +11 -0
- data/lib/jekyll/algolia/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51f8221d0fd59da5c41a3a9dd8496dffd6562989
|
4
|
+
data.tar.gz: 56523270302c22f93d2537cfb8a614bf7c263cca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
[![
|
4
|
-
|
5
|
-
|
6
|
-
[![
|
7
|
-
![
|
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][
|
48
|
-
[your dashboard][
|
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][
|
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://
|
80
|
-
[3]: https://
|
81
|
-
[4]: https://
|
82
|
-
[5]: https://img.shields.io/badge/
|
83
|
-
[6]: https://img.shields.io/badge/
|
84
|
-
[7]: https://
|
85
|
-
[8]: https://www.algolia.com/
|
86
|
-
[9]: https://
|
87
|
-
[10]: https://
|
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
|
-
#
|
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
|
|
data/lib/jekyll/algolia/utils.rb
CHANGED
@@ -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
|
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.
|
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-
|
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
|