jekyll-algolia 1.2.4 → 1.2.5
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 +4 -4
- data/lib/jekyll/algolia/file_browser.rb +14 -7
- 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: a03ae9ed115f3f1acce8a3388c2e1fc930e3c71f
|
4
|
+
data.tar.gz: 02af7e8ad72b9bfa93b31201258d72c08aa3e57c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55d209c13e22c3dd81c7d5983a28339a9029298119e826ebf077d7a3b92d21ee73732aaabaa61744133a63c57d392796442458fb2521e334e8bdcbc7145bc868
|
7
|
+
data.tar.gz: 881a872183278ac2c0325536c9a1e1892f2a8cd713cfd3b89a74e1f8a58065d972a22fec31d932223a94388ff23afe5d514678810fd4606bc554e4146fb0ddc0
|
@@ -244,7 +244,7 @@ module Jekyll
|
|
244
244
|
# error.
|
245
245
|
def self.excerpt_raw(file)
|
246
246
|
Logger.silent do
|
247
|
-
return file.data['excerpt'].to_s
|
247
|
+
return file.data['excerpt'].to_s.strip
|
248
248
|
end
|
249
249
|
rescue StandardError
|
250
250
|
nil
|
@@ -253,13 +253,20 @@ module Jekyll
|
|
253
253
|
# Public: Returns the HTML version of the excerpt
|
254
254
|
#
|
255
255
|
# file - The Jekyll file
|
256
|
-
#
|
257
|
-
# Only collections (including posts) have an excerpt. Pages don't.
|
258
256
|
def self.excerpt_html(file)
|
259
|
-
excerpt
|
260
|
-
|
261
|
-
|
262
|
-
|
257
|
+
# If it's a post with a custom separator for the excerpt, we honor it
|
258
|
+
is_post = (type(file) == 'post')
|
259
|
+
if is_post
|
260
|
+
custom_separator = file.excerpt_separator.to_s.strip
|
261
|
+
return excerpt_raw(file) unless custom_separator.empty?
|
262
|
+
end
|
263
|
+
|
264
|
+
# Otherwise we take the first matching node
|
265
|
+
html = file.content
|
266
|
+
selector = Configurator.algolia('nodes_to_index')
|
267
|
+
first_node = Nokogiri::HTML(html).css(selector).first
|
268
|
+
return nil if first_node.nil?
|
269
|
+
first_node.to_s
|
263
270
|
end
|
264
271
|
|
265
272
|
# Public: Returns the text version of the excerpt
|
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.2.
|
4
|
+
version: 1.2.5
|
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-03-
|
11
|
+
date: 2018-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: algolia_html_extractor
|