cloudcannon-jekyll 1.5.2 → 1.5.3

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: 0407bacd5338d40b0e7b409eda06a76d37a9919783257247f1d3f3690e699efa
4
- data.tar.gz: 06cff77745e8ac590eaad34a544323dd8ca268655b6a62006ffd9572c1e1b402
3
+ metadata.gz: 1622ca2b9f7eef0279882f94f4364c67ffdd9c403dbfc345bc882268ecd0f998
4
+ data.tar.gz: e3dab9c9f8fb8090c16c4c3c963566143bfe9a7d4fc18f674c1b33691c377575
5
5
  SHA512:
6
- metadata.gz: 9261bb287f986877ac87f34ad50a4ed4102b84571a0595fab098021d17a06f7f8132e7e27ce98fa08597e392330db9b206f77f7f96c6e0caad573282776994f0
7
- data.tar.gz: d0d882360b677dd594316b92cf0f4ec3798d35451248fc5ed5d13df002d3015f473463994bf85f9d977b8850a0b66995253c630ff5296aa98b1c045ff901ad00
6
+ metadata.gz: 748183e00870b67a650ce2cd0386519faffc651750504804bd66d0dd133576a714221d64405d7afc9729558ec6eb8719e3105ee349b4155c53c87af3fffc3351
7
+ data.tar.gz: e3d770a079ae5a349b7ceec3c1dc4db930bd294a3856c991520bdfe8624a901d00749f37b4fb825dbdfa1e56f67934179c8b0f0ac585968ec9cc30483e50d96b
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 1.5.3
2
+
3
+ * Rework fallback for older versions of Jekyll when reading data, posts and drafts
4
+ * Fix deprecation warning for `posts.map`
5
+
1
6
  # 1.5.2
2
7
 
3
8
  * Fix for empty collection configurations
@@ -17,6 +22,10 @@
17
22
  * Add `url` to static-pages
18
23
  * Normalise `_path` in static-pages
19
24
 
25
+ # 1.4.3
26
+
27
+ * Fix off-by-one depth for nested documents from last change
28
+
20
29
  # 1.4.2
21
30
 
22
31
  * Added max depth parameter for jsonify filter and increase it for array structures in config output
@@ -49,11 +49,13 @@ module CloudCannonJekyll
49
49
  @site.config["data_dir"] || "_data"
50
50
  end
51
51
 
52
+ # rubocop:disable Metrics/AbcSize
52
53
  def add_category_folder_config(collections_config, posts_config = {})
53
54
  posts = @site.posts || @site.collections["posts"]
55
+ docs = posts.class.method_defined?(:docs) ? posts.docs : posts
54
56
  seen = {}
55
57
 
56
- posts.map do |post|
58
+ docs.map do |post|
57
59
  parts = post.relative_path.split("/_posts/")
58
60
  path = parts.first
59
61
 
@@ -80,6 +82,7 @@ module CloudCannonJekyll
80
82
  path
81
83
  end
82
84
  end
85
+ # rubocop:enable Metrics/AbcSize
83
86
 
84
87
  # Add data to collections config if raw data files exist
85
88
  def add_data_config(collections_config)
@@ -167,7 +167,7 @@ module CloudCannonJekyll
167
167
  def self.to_json(input, depth, max_depth = 9, key_swaps = {})
168
168
  depth += 1
169
169
 
170
- if depth > max_depth || (depth > 2 && JsonifyFilter.document_type?(input))
170
+ if depth > max_depth || (depth > 3 && JsonifyFilter.document_type?(input))
171
171
  '"MAXIMUM_DEPTH"'
172
172
  elsif JsonifyFilter.simple_type?(input)
173
173
  input.to_json
@@ -2,9 +2,9 @@
2
2
 
3
3
  require "jekyll"
4
4
 
5
- if !Jekyll::VERSION.start_with? "2."
5
+ begin
6
6
  require_relative "readers/data-reader"
7
- else
7
+ rescue NameError
8
8
  require_relative "readers/old-data-reader"
9
9
  end
10
10
 
@@ -18,27 +18,21 @@ module CloudCannonJekyll
18
18
  end
19
19
 
20
20
  def read_data(dir = "_data")
21
- if Jekyll::VERSION.start_with? "2."
22
- CloudCannonJekyll::OldDataReader.new(@site).read(dir)
23
- else
24
- CloudCannonJekyll::DataReader.new(@site).read(dir)
25
- end
21
+ CloudCannonJekyll::DataReader.new(@site).read(dir)
22
+ rescue NameError # DataReader doesn't exist in old versions of Jekyll
23
+ CloudCannonJekyll::OldDataReader.new(@site).read(dir)
26
24
  end
27
25
 
28
26
  def read_drafts(dir = "")
29
- if Jekyll::VERSION.start_with? "2."
30
- @site.read_content(dir, "_drafts", Jekyll::Draft)
31
- else
32
- Jekyll::PostReader.new(@site).read_drafts(dir)
33
- end
27
+ Jekyll::PostReader.new(@site).read_drafts(dir)
28
+ rescue NameError # PostReader doesn't exist in old versions of Jekyll
29
+ @site.read_content(dir, "_drafts", Jekyll::Draft)
34
30
  end
35
31
 
36
32
  def read_posts(dir = "")
37
- if Jekyll::VERSION.start_with? "2."
38
- @site.read_content(dir, "_posts", Jekyll::Post)
39
- else
40
- Jekyll::PostReader.new(@site).read_posts(dir)
41
- end
33
+ Jekyll::PostReader.new(@site).read_posts(dir)
34
+ rescue NameError # PostReader doesn't exist in old versions of Jekyll
35
+ @site.read_content(dir, "_posts", Jekyll::Post)
42
36
  end
43
37
  end
44
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudCannonJekyll
4
- VERSION = "1.5.2"
4
+ VERSION = "1.5.3"
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.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - CloudCannon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-25 00:00:00.000000000 Z
11
+ date: 2020-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll