cloudcannon-jekyll 0.3.3 → 0.3.4

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: '08b8d41b4f28b0bca7c2258cea56bb78a4f5681268ceb43cb22c9354dca500b7'
4
- data.tar.gz: 2bd8a07284c6e42ae4c3e4c8f588e085482b8e8a5d7a595cb13e7e62b5490c2d
3
+ metadata.gz: 29ba7626e36d9eda34cdc67fe54a1961c7fc8ea6af3b61d2bfe8e9f7074483c8
4
+ data.tar.gz: 82ea5cfc99366153d6464125652c200ccf0971fca780cf9d5cfbbe5bb70fd9c2
5
5
  SHA512:
6
- metadata.gz: 2787ad164d3525eefe7c1e9797ba74cfd81d9a918839808abb016f83eb98184c32c5057fc0464ee2136929486b350cf7c509ed1779d1458f794a35e86571d14c
7
- data.tar.gz: cb5e1901ccd2a0d94a4adb11b5d693101d03588f1b5ba4cc866c1ce6ca49c92c79f4c78927b6b671ce8b1748d72e4e895d64ee9d50033720be08a0634521bc61
6
+ metadata.gz: 958d22f6c30642a9ef324aba1938768a8b7337b948f33780f2545a310c12e9535328a52367fa888d267a18b6572d07ef1d7387fdab9956211830c448946b52c2
7
+ data.tar.gz: 6c2dee57baf7d6fac11898094e3292c89559ac4d5077b898efdc65c1901df351101d37ef240de02eebd2db2dc2adfc9bd288ca232d7f9b3bd4f9ba8aeb36b177
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.3.4
2
+
3
+ * Re-add id field for documents
4
+ * Fix for potential nil reference
5
+
1
6
  # 0.3.3
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
@@ -108,7 +108,7 @@ module CloudCannonJekyll
108
108
  end
109
109
 
110
110
  def self.document_to_json(input, depth, max_depth)
111
- prevent = %w(dir id relative_path url collection)
111
+ prevent = %w(dir relative_path url collection)
112
112
 
113
113
  out = [
114
114
  "\"path\": #{JsonifyFilter.to_json(input.relative_path, depth, max_depth)}",
@@ -121,6 +121,10 @@ module CloudCannonJekyll
121
121
  out.push("\"collection\": #{collection_json}")
122
122
  end
123
123
 
124
+ if input.respond_to? :id
125
+ out.push("\"id\": #{JsonifyFilter.to_json(input.id, depth, max_depth)}")
126
+ end
127
+
124
128
  out += JsonifyFilter.document_data_to_a(input.data, prevent, depth, max_depth)
125
129
  "{#{out.join(",")}}"
126
130
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudCannonJekyll
4
- VERSION = "0.3.3"
4
+ VERSION = "0.3.4"
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: 0.3.3
4
+ version: 0.3.4
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