cloudcannon-jekyll 1.5.4 → 1.5.5

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
  SHA256:
3
- metadata.gz: 176cf49b411a0986cc9b6ac1721ce6fcf2b7be830e39a28a4ecefd932d1bc393
4
- data.tar.gz: 1528f083504f444305ad7361b3d9f3bd3638259271a9e71b27dc0711e4348078
3
+ metadata.gz: 431460a2de8c6f3ec5dbfeb75e2354c48f25ac80f4761ef926dbee4fbdf10f63
4
+ data.tar.gz: 255202d3a0205cc9ee087d93ae2a96c59bbf662d3b335193cd6f2dedde6a917d
5
5
  SHA512:
6
- metadata.gz: 39dc2b3e26908d529d95b76789b147eb6c6f3265fb6d86f179faa96e6620897275c638a6f86f4fe6eb6411006debfac3f4f6e53280aff736aa4c8263cf9bd2ef
7
- data.tar.gz: eb61277cf35e5729631962cd3e66162ee3d202d38e69f134b56f28d539d238b83daf1781167031bab059f46b86dba7154560824996bc456b45a253f62f11ea62
6
+ metadata.gz: ef6b43da5dc6bcdf08a8f8a7b711bb2b2a73cd28a48729c194eef89d7fbdc80bce2cf298f52fecb09695dbe25a0887f266f8e36887f8d888a29d41b8b6bfb23a
7
+ data.tar.gz: d456a64c940b19738d6588b9a69c05d69b3f13c143ffa849f028df78cde665152f723be143760cfa964244bc914950b3634099a62b2ca04a2293291d46523e64
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 1.5.5
2
+
3
+ * Re-add id field for documents
4
+ * Fix for potential nil reference
5
+
1
6
  # 1.5.4
2
7
 
3
8
  * Rework fallback for older versions of Jekyll when reading data, posts and drafts again
@@ -13,7 +13,7 @@ module CloudCannonJekyll
13
13
  @site = site
14
14
  @reader = Reader.new(@site)
15
15
 
16
- collections_config = @site.config["collections"].dup || {}
16
+ collections_config = @site.config["collections"]&.dup || {}
17
17
 
18
18
  # Workaround for empty collection configurations
19
19
  collections_config.each_key do |key|
@@ -96,7 +96,7 @@ module CloudCannonJekyll
96
96
  drafts = @reader.read_drafts(collections_dir)
97
97
 
98
98
  if collections_config.key?("posts")
99
- collections_config["drafts"] = collections_config["posts"].dup
99
+ collections_config["drafts"] = collections_config["posts"]&.dup || {}
100
100
  elsif drafts.any?
101
101
  collections_config["drafts"] = {}
102
102
  end
@@ -107,7 +107,7 @@ module CloudCannonJekyll
107
107
  end
108
108
 
109
109
  def self.document_to_json(input, depth, max_depth)
110
- prevent = %w(dir id relative_path url collection)
110
+ prevent = %w(dir relative_path url collection)
111
111
 
112
112
  out = [
113
113
  "\"path\": #{JsonifyFilter.to_json(input.relative_path, depth, max_depth)}",
@@ -120,6 +120,10 @@ module CloudCannonJekyll
120
120
  out.push("\"collection\": #{collection_json}")
121
121
  end
122
122
 
123
+ if input.respond_to? :id
124
+ out.push("\"id\": #{JsonifyFilter.to_json(input.id, depth, max_depth)}")
125
+ end
126
+
123
127
  out += JsonifyFilter.document_data_to_a(input.data, prevent, depth, max_depth)
124
128
  "{#{out.join(",")}}"
125
129
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudCannonJekyll
4
- VERSION = "1.5.4"
4
+ VERSION = "1.5.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudcannon-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - CloudCannon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-13 00:00:00.000000000 Z
11
+ date: 2020-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll