jekyll-algolia 1.4.6 → 1.4.7

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: 25dcef305ae5defcbd052350a93537507a4423c4
4
- data.tar.gz: 4abd3043c0e9193fc6909c5e9cf70b9f3e9bdf44
3
+ metadata.gz: 8fcc627a7b1dd5f0969aee5dd9b11520172b56b0
4
+ data.tar.gz: 2c0e87cf5c96179356da5d91c99b18a66d123c99
5
5
  SHA512:
6
- metadata.gz: 95ca76fff66cbc98d960236fce7badc45c09f27f466cf4a75e95bc92f36b339cab5a9954820c33b7b185100ba380eb2449a3097c76cc35fdebba9449e9cb2d7e
7
- data.tar.gz: 83467fa8bf2c28a3cc86834b94748cae4d02d9f927965c37e96700940c79172f94f91eac1ccb3b78f0b3e839f9bd5e1cc412f2b30baee5f24028fdcefcec02f0
6
+ metadata.gz: '095ff54e1d9f31b5110d534bebbab7a8390dff9f8095ee95632e947d5adcd079fc33b9255ac1b6e900ec2183683f07ab27e3f30c7de7ae79903757e89ffdcdd3'
7
+ data.tar.gz: eb31b4f658e1097feb27a5d4762b0eab6087f11086c958c8acf727b6dfbb10e25ff6600c4e47c939aa17815b229feef230de636f999bd96aae2097d3ae86c996
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'algolia_html_extractor'
4
4
  require 'pathname'
5
+ require 'time'
5
6
 
6
7
  module Jekyll
7
8
  module Algolia
@@ -234,7 +235,7 @@ module Jekyll
234
235
  def self.date(file)
235
236
  # Collections get their date from .date, while pages read it from .data.
236
237
  # Jekyll by default will set the date of collection to the current date,
237
- # but we overwrote this.
238
+ # but we monkey-patched that so it returns nil for collection items
238
239
  date = if file.respond_to?(:date)
239
240
  file.date
240
241
  else
@@ -242,6 +243,16 @@ module Jekyll
242
243
  end
243
244
 
244
245
  return nil if date.nil?
246
+
247
+ # If date is a string, we try to parse it
248
+ if date.is_a? String
249
+ begin
250
+ date = Time.parse(date)
251
+ rescue StandardError
252
+ return nil
253
+ end
254
+ end
255
+
245
256
  date.to_time.to_i
246
257
  end
247
258
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Algolia
5
- VERSION = '1.4.6'
5
+ VERSION = '1.4.7'
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.4.6
4
+ version: 1.4.7
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-07-18 00:00:00.000000000 Z
11
+ date: 2018-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: algolia_html_extractor