cloudcannon-jekyll 2.0.1 → 2.0.2
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 +4 -4
- data/HISTORY.md +6 -0
- data/lib/cloudcannon-jekyll/_cloudcannon/info-2.x.json +5 -2
- data/lib/cloudcannon-jekyll/_cloudcannon/info-3.0-4.x.json +5 -2
- data/lib/cloudcannon-jekyll/_cloudcannon/info.json +5 -2
- data/lib/cloudcannon-jekyll/jsonify-filter.rb +11 -28
- data/lib/cloudcannon-jekyll/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ba3dd6e0f966b1e258e25c63e10ca6b38d6b1fa5eef20867e35f4e1d3679584
|
4
|
+
data.tar.gz: 6cc8bc3ecc01cabcbce3e9f9691a9acf296a8e703651f1c9e6defd59c9467660
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0df6f5ab7cef31e3481b85a0485bddebbd088a7211dc5a82bd7487964c5650963ed583feaf8674603c8831fef5f00b5e4376dc6d5377bf05da6c9c0653a0046e
|
7
|
+
data.tar.gz: 80ad95aa7b61d49a41f908f834d616b493d027d5f9c2feaf38205db236895a19be9d320c8736f7a8d2ec01909e357d012615d2b09d6f565c5772607ed2c13638
|
data/HISTORY.md
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
{% if config.timezone %}
|
18
18
|
"timezone": {{ config.timezone | cc_jsonify }},
|
19
19
|
{% endif %}
|
20
|
-
"collections-config": {{ collections_config | cc_jsonify
|
20
|
+
"collections-config": {{ collections_config | cc_jsonify }},
|
21
21
|
"collections": {
|
22
22
|
"drafts": {{ drafts | cc_jsonify }},
|
23
23
|
"posts": {{ site.posts | reverse | cc_jsonify }}{% if site.collections.size > 0 %},{% endif %}
|
@@ -36,6 +36,9 @@
|
|
36
36
|
{% if config._comments %}
|
37
37
|
"_comments": {{ config._comments | cc_jsonify }},
|
38
38
|
{% endif %}
|
39
|
+
{% if config._enabled_editors %}
|
40
|
+
"_enabled_editors": {{ config._enabled_editors | cc_jsonify }},
|
41
|
+
{% endif %}
|
39
42
|
{% if config._options %}
|
40
43
|
"_options": {{ config._options | cc_jsonify }},
|
41
44
|
{% endif %}
|
@@ -63,7 +66,7 @@
|
|
63
66
|
"layouts": {{ config.layouts_dir | cc_jsonify }}
|
64
67
|
},
|
65
68
|
{% if config._array_structures %}
|
66
|
-
"_array_structures": {{ config._array_structures | cc_jsonify:
|
69
|
+
"_array_structures": {{ config._array_structures | cc_jsonify: 50 }},
|
67
70
|
{% endif %}
|
68
71
|
{% assign select_data = config | cc_select_data_jsonify %}
|
69
72
|
{% if select_data %}
|
@@ -17,7 +17,7 @@
|
|
17
17
|
{% if config.timezone %}
|
18
18
|
"timezone": {{ config.timezone | cc_jsonify }},
|
19
19
|
{% endif %}
|
20
|
-
"collections-config": {{ collections_config | cc_jsonify
|
20
|
+
"collections-config": {{ collections_config | cc_jsonify }},
|
21
21
|
"collections": {
|
22
22
|
"drafts": {{ drafts | cc_jsonify }}{% if site.collections.size > 0 %},{% endif %}
|
23
23
|
{% for collection in site.collections %}"{{ collection.label | xml_escape }}": {{ collection.docs | cc_jsonify }}{% unless forloop.last %},{% endunless %}
|
@@ -35,6 +35,9 @@
|
|
35
35
|
{% if config._comments %}
|
36
36
|
"_comments": {{ config._comments | cc_jsonify }},
|
37
37
|
{% endif %}
|
38
|
+
{% if config._enabled_editors %}
|
39
|
+
"_enabled_editors": {{ config._enabled_editors | cc_jsonify }},
|
40
|
+
{% endif %}
|
38
41
|
{% if config._options %}
|
39
42
|
"_options": {{ config._options | cc_jsonify }},
|
40
43
|
{% endif %}
|
@@ -62,7 +65,7 @@
|
|
62
65
|
"layouts": {{ config.layouts_dir | cc_jsonify }}
|
63
66
|
},
|
64
67
|
{% if config._array_structures %}
|
65
|
-
"_array_structures": {{ config._array_structures | cc_jsonify:
|
68
|
+
"_array_structures": {{ config._array_structures | cc_jsonify: 50 }},
|
66
69
|
{% endif %}
|
67
70
|
{% assign select_data = config | cc_select_data_jsonify %}
|
68
71
|
{% if select_data %}
|
@@ -17,7 +17,7 @@
|
|
17
17
|
{% if config.timezone -%}
|
18
18
|
"timezone": {{ config.timezone | cc_jsonify }},
|
19
19
|
{%- endif %}
|
20
|
-
"collections-config": {{ collections_config | cc_jsonify
|
20
|
+
"collections-config": {{ collections_config | cc_jsonify }},
|
21
21
|
"collections": {
|
22
22
|
"drafts": {{ drafts | cc_jsonify }}{% if site.collections.size > 0 %},{% endif %}
|
23
23
|
{%- for collection in site.collections -%}
|
@@ -48,6 +48,9 @@
|
|
48
48
|
{% if config._comments -%}
|
49
49
|
"_comments": {{ config._comments | cc_jsonify }},
|
50
50
|
{%- endif %}
|
51
|
+
{% if config._enabled_editors -%}
|
52
|
+
"_enabled_editors": {{ config._enabled_editors | cc_jsonify }},
|
53
|
+
{%- endif %}
|
51
54
|
{% if config._options -%}
|
52
55
|
"_options": {{ config._options | cc_jsonify }},
|
53
56
|
{%- endif %}
|
@@ -75,7 +78,7 @@
|
|
75
78
|
"layouts": {{ config.layouts_dir | cc_jsonify }}
|
76
79
|
},
|
77
80
|
{% if config._array_structures -%}
|
78
|
-
"_array_structures": {{ config._array_structures | cc_jsonify:
|
81
|
+
"_array_structures": {{ config._array_structures | cc_jsonify: 50 }},
|
79
82
|
{%- endif %}
|
80
83
|
{% assign select_data = config | cc_select_data_jsonify -%}
|
81
84
|
{% if select_data -%}
|
@@ -7,19 +7,6 @@ module CloudCannonJekyll
|
|
7
7
|
module JsonifyFilter
|
8
8
|
STATIC_EXTENSIONS = [".html", ".htm"].freeze
|
9
9
|
|
10
|
-
CC_JSONIFY_KEY_SWAPS = {
|
11
|
-
"collections" => {
|
12
|
-
"_sort_key" => "_sort-key",
|
13
|
-
"_subtext_key" => "_subtext-key",
|
14
|
-
"_image_key" => "_image-key",
|
15
|
-
"_image_size" => "_image-size",
|
16
|
-
"_singular_name" => "_singular-name",
|
17
|
-
"_singular_key" => "_singular-key",
|
18
|
-
"_disable_add" => "_disable-add",
|
19
|
-
"_add_options" => "_add-options",
|
20
|
-
},
|
21
|
-
}.freeze
|
22
|
-
|
23
10
|
@simple_types = [
|
24
11
|
String,
|
25
12
|
Numeric,
|
@@ -137,19 +124,19 @@ module CloudCannonJekyll
|
|
137
124
|
"{#{out.join(",")}}"
|
138
125
|
end
|
139
126
|
|
140
|
-
def self.array_to_json(input, depth, max_depth
|
127
|
+
def self.array_to_json(input, depth, max_depth)
|
141
128
|
array = input.map do |value|
|
142
|
-
JsonifyFilter.to_json(value, depth, max_depth
|
129
|
+
JsonifyFilter.to_json(value, depth, max_depth)
|
143
130
|
end
|
144
131
|
|
145
132
|
"[#{array.join(",")}]"
|
146
133
|
end
|
147
134
|
|
148
|
-
def self.hash_to_json(input, depth, max_depth
|
135
|
+
def self.hash_to_json(input, depth, max_depth)
|
149
136
|
out = input.map do |key, value|
|
150
137
|
next_max_depth = key == "_array_structures" ? 20 : max_depth
|
151
|
-
string_key =
|
152
|
-
"#{string_key}: #{JsonifyFilter.to_json(value, depth, next_max_depth
|
138
|
+
string_key = key.to_s.to_json
|
139
|
+
"#{string_key}: #{JsonifyFilter.to_json(value, depth, next_max_depth)}"
|
153
140
|
end
|
154
141
|
|
155
142
|
"{#{out.join(",")}}"
|
@@ -163,7 +150,7 @@ module CloudCannonJekyll
|
|
163
150
|
baseurl show_dir_listing permalink paginate_path timezone quiet verbose defaults
|
164
151
|
liquid kramdown title url description uploads_dir _comments _options _editor
|
165
152
|
_explore _source_editor _array_structures maruku redcloth rdiscount redcarpet
|
166
|
-
gems plugins cloudcannon _collection_groups)
|
153
|
+
gems plugins cloudcannon _collection_groups _enabled_editors)
|
167
154
|
|
168
155
|
out = input.map do |key, value|
|
169
156
|
next unless value.is_a?(Array) || value.is_a?(Hash)
|
@@ -178,7 +165,7 @@ module CloudCannonJekyll
|
|
178
165
|
"{#{out.join(",")}}" if out.any?
|
179
166
|
end
|
180
167
|
|
181
|
-
def self.to_json(input, depth, max_depth =
|
168
|
+
def self.to_json(input, depth, max_depth = 12)
|
182
169
|
depth += 1
|
183
170
|
|
184
171
|
if depth > max_depth || (depth > 3 && JsonifyFilter.document_type?(input))
|
@@ -194,9 +181,9 @@ module CloudCannonJekyll
|
|
194
181
|
elsif input.is_a?(Jekyll::Document)
|
195
182
|
JsonifyFilter.document_to_json(input, depth, max_depth)
|
196
183
|
elsif input.is_a?(Array)
|
197
|
-
JsonifyFilter.array_to_json(input, depth, max_depth
|
184
|
+
JsonifyFilter.array_to_json(input, depth, max_depth)
|
198
185
|
elsif input.is_a?(Hash)
|
199
|
-
JsonifyFilter.hash_to_json(input, depth, max_depth
|
186
|
+
JsonifyFilter.hash_to_json(input, depth, max_depth)
|
200
187
|
else
|
201
188
|
input.class.to_s.prepend("UNSUPPORTED:").to_json
|
202
189
|
end
|
@@ -220,12 +207,8 @@ module CloudCannonJekyll
|
|
220
207
|
end
|
221
208
|
end
|
222
209
|
|
223
|
-
def cc_jsonify(input,
|
224
|
-
|
225
|
-
JsonifyFilter.to_json(input, 0, max_depth, CC_JSONIFY_KEY_SWAPS[key_swaps_key])
|
226
|
-
else
|
227
|
-
JsonifyFilter.to_json(input, 0, max_depth)
|
228
|
-
end
|
210
|
+
def cc_jsonify(input, max_depth = 12)
|
211
|
+
JsonifyFilter.to_json(input, 0, max_depth)
|
229
212
|
end
|
230
213
|
end
|
231
214
|
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.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CloudCannon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|