cloudcannon-jekyll 2.3.0 → 2.3.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a8badc065e548c467c7c794747e3f7147eeb8b200f19fe73aef583a026ab657
4
- data.tar.gz: e6fa47b31b8801e4f6b106574cf15584a56299be5dff80128a2c12b325d6d77e
3
+ metadata.gz: '09003d2ad672bafc2165e8a667a19c2a730651ddba0fd201904a8575e4c5bba0'
4
+ data.tar.gz: 5988731017bdd55c1d2600409ee8e0380847552a79bdc6ef0ff445e810132715
5
5
  SHA512:
6
- metadata.gz: 60a58b7deaeaff3265a13ad0b14b1fe68229b53f1b413a08d7859167c3acc3da2ecef016372b08f630705edd14040167be6e9b15323344948e6856f4666c3bf6
7
- data.tar.gz: 5c3d1b8402f2178eea44a03743d9d3985a19984795ff320dc9e34e106c3d19e0d34782e34f8d6905d039b36917a87bfe57dfe88f4288b4bf2575fe3fddc13acf
6
+ metadata.gz: beabc519bea263502f085226ffb98b27d6aa2cd882ca5efe710f63287afaaaeb80f47eea3f118447bbed3d1f89c51c17f6d77134adc5a3f7e11a983ce969e53e
7
+ data.tar.gz: d77019b69275bb04a010fa7ce8a0c3763e7a9e1ce449741f62a9e945a5454ffb03fb7395c463cc4434722653156f989a4be81bdac6781bc0efa495c7afc2a2be
data/HISTORY.md CHANGED
@@ -1,3 +1,20 @@
1
+ # 2.3.4
2
+
3
+ * Add `_editables`
4
+
5
+ # 2.3.3
6
+
7
+ * Add `_structures`
8
+
9
+ # 2.3.2
10
+
11
+ * Add `_inputs`
12
+
13
+ # 2.3.1
14
+
15
+ * Fix issue where pages config overwrites default
16
+ * Fix issue when a site has no pages
17
+
1
18
  # 2.3.0
2
19
 
3
20
  * Fix output for drafts collection config
@@ -38,6 +38,12 @@
38
38
  {% if config._options %}
39
39
  "_options": {{ config._options | cc_jsonify }},
40
40
  {% endif %}
41
+ {% if config._inputs %}
42
+ "_inputs": {{ config._inputs | cc_jsonify }},
43
+ {% endif %}
44
+ {% if config._editables %}
45
+ "_editables": {{ config._editables | cc_jsonify }},
46
+ {% endif %}
41
47
  {% if config._collection_groups %}
42
48
  "_collection_groups": {{ config._collection_groups | cc_jsonify }},
43
49
  {% endif %}
@@ -60,6 +66,9 @@
60
66
  "collections": {{ config.collections_dir | cc_jsonify }},
61
67
  "layouts": {{ config.layouts_dir | cc_jsonify }}
62
68
  },
69
+ {% if config._structures %}
70
+ "_structures": {{ config._structures | cc_jsonify: 50 }},
71
+ {% endif %}
63
72
  {% if config._array_structures %}
64
73
  "_array_structures": {{ config._array_structures | cc_jsonify: 50 }},
65
74
  {% endif %}
@@ -38,6 +38,12 @@
38
38
  {% if config._options %}
39
39
  "_options": {{ config._options | cc_jsonify }},
40
40
  {% endif %}
41
+ {% if config._inputs %}
42
+ "_inputs": {{ config._inputs | cc_jsonify }},
43
+ {% endif %}
44
+ {% if config._editables %}
45
+ "_editables": {{ config._editables | cc_jsonify }},
46
+ {% endif %}
41
47
  {% if config._collection_groups %}
42
48
  "_collection_groups": {{ config._collection_groups | cc_jsonify }},
43
49
  {% endif %}
@@ -60,6 +66,9 @@
60
66
  "collections": {{ config.collections_dir | cc_jsonify }},
61
67
  "layouts": {{ config.layouts_dir | cc_jsonify }}
62
68
  },
69
+ {% if config._structures %}
70
+ "_structures": {{ config._structures | cc_jsonify: 50 }},
71
+ {% endif %}
63
72
  {% if config._array_structures %}
64
73
  "_array_structures": {{ config._array_structures | cc_jsonify: 50 }},
65
74
  {% endif %}
@@ -41,6 +41,12 @@
41
41
  {% if config._options -%}
42
42
  "_options": {{ config._options | cc_jsonify }},
43
43
  {%- endif %}
44
+ {% if config._inputs -%}
45
+ "_inputs": {{ config._inputs | cc_jsonify }},
46
+ {%- endif %}
47
+ {% if config._editables -%}
48
+ "_editables": {{ config._editables | cc_jsonify }},
49
+ {%- endif %}
44
50
  {% if config._collection_groups -%}
45
51
  "_collection_groups": {{ config._collection_groups | cc_jsonify }},
46
52
  {%- endif %}
@@ -63,6 +69,9 @@
63
69
  "collections": {{ config.collections_dir | cc_jsonify }},
64
70
  "layouts": {{ config.layouts_dir | cc_jsonify }}
65
71
  },
72
+ {% if config._structures -%}
73
+ "_structures": {{ config._structures | cc_jsonify: 50 }},
74
+ {%- endif %}
66
75
  {% if config._array_structures -%}
67
76
  "_array_structures": {{ config._array_structures | cc_jsonify: 50 }},
68
77
  {%- endif %}
@@ -44,6 +44,7 @@ module CloudCannonJekyll
44
44
  end
45
45
  # rubocop:enable Metrics/MethodLength
46
46
 
47
+ # rubocop:disable Metrics/CyclomaticComplexity
47
48
  def generate_collections_config(pages)
48
49
  collections = @site.config["collections"]&.dup || {}
49
50
  collections_config = @site.config.dig("cloudcannon", "collections")&.dup || {}
@@ -54,18 +55,20 @@ module CloudCannonJekyll
54
55
  collections_config[key] = (collections_config[key] || {}).merge(defaults)
55
56
  end
56
57
 
57
- unless pages.empty?
58
- collections_config["pages"] ||= {
58
+ unless pages.empty? || collections.key?("pages")
59
+ pages_defaults = {
59
60
  "output" => true,
60
61
  "filter" => "strict",
61
62
  "path" => "",
62
63
  }
64
+
65
+ collections_config["pages"] = pages_defaults.merge(collections_config["pages"] || {})
63
66
  end
64
67
 
65
68
  collections_config
66
69
  end
67
70
 
68
- # rubocop:disable Metrics/CyclomaticComplexity
71
+ # rubocop:disable Metrics/PerceivedComplexity
69
72
  def generate_collections(collections_config, pages, drafts)
70
73
  split_posts = group_by_category_folder(all_posts, "posts")
71
74
  split_drafts = group_by_category_folder(drafts, "drafts")
@@ -83,9 +86,11 @@ module CloudCannonJekyll
83
86
  collections[key] ||= []
84
87
  end
85
88
 
86
- collections["pages"] = pages if collections["pages"].empty? && !pages.empty?
89
+ has_collection_pages = collections.key?("pages") && !collections["pages"].empty?
90
+ collections["pages"] = pages unless pages.empty? || has_collection_pages
87
91
  collections
88
92
  end
93
+ # rubocop:enable Metrics/PerceivedComplexity
89
94
  # rubocop:enable Metrics/CyclomaticComplexity
90
95
 
91
96
  def generate_data
@@ -50,7 +50,7 @@ module CloudCannonJekyll
50
50
  next if prevent.include?(key) || key.nil?
51
51
 
52
52
  prevent.push key
53
- next_max_depth = key == "_array_structures" ? 20 : max_depth
53
+ next_max_depth = %w(_array_structures _structures).include?(key) ? 20 : max_depth
54
54
  "#{key.to_json}: #{JsonifyFilter.to_json(value, depth, next_max_depth)}"
55
55
  end
56
56
 
@@ -134,7 +134,7 @@ module CloudCannonJekyll
134
134
 
135
135
  def self.hash_to_json(input, depth, max_depth)
136
136
  out = input.map do |key, value|
137
- next_max_depth = key == "_array_structures" ? 20 : max_depth
137
+ next_max_depth = %w(_array_structures _structures).include?(key) ? 20 : max_depth
138
138
  string_key = key.to_s.to_json
139
139
  "#{string_key}: #{JsonifyFilter.to_json(value, depth, next_max_depth)}"
140
140
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudCannonJekyll
4
- VERSION = "2.3.0"
4
+ VERSION = "2.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: 2.3.0
4
+ version: 2.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: 2021-11-07 00:00:00.000000000 Z
11
+ date: 2021-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll