cloudcannon-jekyll 1.5.5 → 2.0.0

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: 431460a2de8c6f3ec5dbfeb75e2354c48f25ac80f4761ef926dbee4fbdf10f63
4
- data.tar.gz: 255202d3a0205cc9ee087d93ae2a96c59bbf662d3b335193cd6f2dedde6a917d
3
+ metadata.gz: aa855266f0cf697d2c9933a087c363ee3f1b81659a71f0b9dbdc2d36d42d5c29
4
+ data.tar.gz: d43d27f97b01e437f4ca6e4f73b066cd7fa53aa67623637a43edfa6b9931cf28
5
5
  SHA512:
6
- metadata.gz: ef6b43da5dc6bcdf08a8f8a7b711bb2b2a73cd28a48729c194eef89d7fbdc80bce2cf298f52fecb09695dbe25a0887f266f8e36887f8d888a29d41b8b6bfb23a
7
- data.tar.gz: d456a64c940b19738d6588b9a69c05d69b3f13c143ffa849f028df78cde665152f723be143760cfa964244bc914950b3634099a62b2ca04a2293291d46523e64
6
+ metadata.gz: 8e9dc486faa0469d5a93b68a48f8c9bbc36330db04e383ac6e801491581a768aa0c57705b09274a4585d1b796ae4b7a097d1209b17cfa6fc5150b57e680a7af9
7
+ data.tar.gz: 37973b235d6ba9c4e30590d25b01de05cc027f90539ca51bc3438b1a09fc510323bbd19cb58e6083e89c683b27caab655f8be0233d6c27e8b282d4cf830f40cc
data/.gitignore CHANGED
@@ -1,7 +1,7 @@
1
1
  Gemfile.lock
2
2
  spec/dest/
3
- spec/fixtures/.jekyll-cache/
4
- spec/fixtures/.jekyll-metadata
3
+ spec/fixtures/**/.jekyll-cache/
4
+ spec/fixtures/**/.jekyll-metadata
5
5
  spec/fixtures/_site/
6
6
  gemfiles/.bundle/
7
7
  gemfiles/*.gemfile.lock
data/.travis.yml CHANGED
@@ -16,4 +16,4 @@ env:
16
16
  - JEKYLL_VERSION="2.4.0"
17
17
  - JEKYLL_VERSION="3.0.0"
18
18
  - JEKYLL_VERSION="3.8.5"
19
- - JEKYLL_VERSION="4.1.1"
19
+ - JEKYLL_VERSION="4.2.0"
data/HISTORY.md CHANGED
@@ -1,3 +1,25 @@
1
+ # 2.0.0
2
+
3
+ * Rename a number of top level configuration keys to match source keys
4
+ * Combine `details.json` and `config.json` into `info.json`
5
+
6
+ # 1.6.1
7
+
8
+ * Increase max depth for array structures defined outside of global
9
+
10
+ # 1.6.0
11
+
12
+ * Add `collections_dir` to details collection item paths
13
+
14
+ # 1.5.7
15
+
16
+ * Fix pages collection clash with built-in pages
17
+ * Fixed posts collection config data overwriting drafts data
18
+
19
+ # 1.5.6
20
+
21
+ * Force generator to run after other lowest priority plugins
22
+
1
23
  # 1.5.5
2
24
 
3
25
  * Re-add id field for documents
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A Jekyll plugin to create CloudCannon editor details.
4
4
 
5
- [![Build Status](https://travis-ci.com/CloudCannon/cloudcannon-jekyll.svg?branch=master)](https://travis-ci.com/CloudCannon/cloudcannon-jekyll) [![Gem Version](https://badge.fury.io/rb/cloudcannon-jekyll.svg)](https://badge.fury.io/rb/cloudcannon-jekyll)
5
+ [![Build Status](https://travis-ci.com/CloudCannon/cloudcannon-jekyll.svg?branch=main)](https://travis-ci.com/CloudCannon/cloudcannon-jekyll) [![Gem Version](https://badge.fury.io/rb/cloudcannon-jekyll.svg)](https://badge.fury.io/rb/cloudcannon-jekyll)
6
6
 
7
7
  ## Usage
8
8
 
@@ -0,0 +1,76 @@
1
+ {
2
+ "time": {{ site.time | date_to_xmlschema | cc_jsonify }},
3
+ "cloudcannon": {
4
+ "name": "cloudcannon-jekyll",
5
+ "version": {{ gem_version | cc_jsonify }}
6
+ },
7
+ "generator": {
8
+ "name": "jekyll",
9
+ "version": {{ jekyll.version | cc_jsonify }},
10
+ "environment": {{ jekyll.env | cc_jsonify }},
11
+ "metadata": {
12
+ "markdown": {{ site.markdown | cc_jsonify }},
13
+ "kramdown": {{ site.kramdown | cc_jsonify }},
14
+ "commonmark": {{ site.commonmark | cc_jsonify }}
15
+ }
16
+ },
17
+ {% if config.timezone %}
18
+ "timezone": {{ config.timezone | cc_jsonify }},
19
+ {% endif %}
20
+ "collections-config": {{ collections_config | cc_jsonify: 'collections' }},
21
+ "collections": {
22
+ "drafts": {{ drafts | cc_jsonify }},
23
+ "posts": {{ site.posts | reverse | cc_jsonify }}{% if site.collections.size > 0 %},{% endif %}
24
+ {% for collection in site.collections %}"{{ collection[0] | xml_escape }}": {{ collection[1].docs | cc_jsonify }}{% unless forloop.last %},{% endunless %}
25
+ {% endfor %}
26
+ },
27
+ "pages": {{ site.html_pages | cc_jsonify }},
28
+ "static-pages": {{ site.static_files | cc_static_files_jsonify }},
29
+ {% if site.cloudcannon.data.first %}{% assign data_seen = false %}
30
+ "data": {
31
+ {% for data in site.data %}{% assign key = data[0] %}{% if site.cloudcannon.data[key] %}{% if data_seen %},{% endif %}{{ data[0] | cc_jsonify }}: {{ data[1] | cc_jsonify }}{% assign data_seen = true %}{% endif %}{% endfor %}},
32
+ {% elsif site.cloudcannon.data %}"data": {{ site.data | cc_jsonify }},{% endif %}
33
+ {% if config.baseurl %}
34
+ "base-url": {{ config.baseurl | cc_jsonify }},
35
+ {% endif %}
36
+ {% if config._comments %}
37
+ "_comments": {{ config._comments | cc_jsonify }},
38
+ {% endif %}
39
+ {% if config._options %}
40
+ "_options": {{ config._options | cc_jsonify }},
41
+ {% endif %}
42
+ {% if config._collection_groups %}
43
+ "_collection_groups": {{ config._collection_groups | cc_jsonify }},
44
+ {% endif %}
45
+ {% if config._editor %}
46
+ "_editor": {
47
+ "default_path": {{ config._editor.default_path | cc_jsonify }}
48
+ },
49
+ {% endif %}
50
+ {% if config._source_editor %}
51
+ "_source_editor": {
52
+ "tab_size": {{ config._source_editor.tab_size | cc_jsonify }},
53
+ "show_gutter": {{ config._source_editor.show_gutter | cc_jsonify }},
54
+ "theme": {{ config._source_editor.theme | cc_jsonify }}
55
+ },
56
+ {% endif %}
57
+ "paths": {
58
+ "uploads": {{ config.uploads_dir | cc_jsonify }},
59
+ "data": {{ config.data_dir | cc_jsonify }},
60
+ "pages": "",
61
+ "collections": {{ config.collections_dir | cc_jsonify }},
62
+ "includes": {{ config.includes_dir | cc_jsonify }},
63
+ "layouts": {{ config.layouts_dir | cc_jsonify }}
64
+ },
65
+ {% if config._array_structures %}
66
+ "_array_structures": {{ config._array_structures | cc_jsonify: nil, 50 }},
67
+ {% endif %}
68
+ {% assign select_data = config | cc_select_data_jsonify %}
69
+ {% if select_data %}
70
+ "_select_data": {{ select_data }},
71
+ {% endif %}
72
+ {% if config.defaults %}
73
+ "defaults": {{ config.defaults | cc_jsonify }},
74
+ {% endif %}
75
+ "source": {{ config.source | replace: pwd, "" | cc_jsonify }}
76
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "time": {{ site.time | date_to_xmlschema | cc_jsonify }},
3
+ "cloudcannon": {
4
+ "name": "cloudcannon-jekyll",
5
+ "version": {{ gem_version | cc_jsonify }}
6
+ },
7
+ "generator": {
8
+ "name": "jekyll",
9
+ "version": {{ jekyll.version | cc_jsonify }},
10
+ "environment": {{ jekyll.env | cc_jsonify }},
11
+ "metadata": {
12
+ "markdown": {{ site.markdown | cc_jsonify }},
13
+ "kramdown": {{ site.kramdown | cc_jsonify }},
14
+ "commonmark": {{ site.commonmark | cc_jsonify }}
15
+ }
16
+ },
17
+ {% if config.timezone %}
18
+ "timezone": {{ config.timezone | cc_jsonify }},
19
+ {% endif %}
20
+ "collections-config": {{ collections_config | cc_jsonify: 'collections' }},
21
+ "collections": {
22
+ "drafts": {{ drafts | cc_jsonify }}{% if site.collections.size > 0 %},{% endif %}
23
+ {% for collection in site.collections %}"{{ collection.label | xml_escape }}": {{ collection.docs | cc_jsonify }}{% unless forloop.last %},{% endunless %}
24
+ {% endfor %}
25
+ },
26
+ "pages": {{ site.html_pages | cc_jsonify }},
27
+ "static-pages": {{ site.static_files | cc_static_files_jsonify }},
28
+ {% if site.cloudcannon.data.first %}{% assign data_seen = false %}
29
+ "data": {
30
+ {% for data in site.data %}{% assign key = data[0] %}{% if site.cloudcannon.data[key] %}{% if data_seen %},{% endif %}{{ data[0] | cc_jsonify }}: {{ data[1] | cc_jsonify }}{% assign data_seen = true %}{% endif %}{% endfor %}},
31
+ {% elsif site.cloudcannon.data %}"data": {{ site.data | cc_jsonify }},{% endif %}
32
+ {% if config.baseurl %}
33
+ "base-url": {{ config.baseurl | cc_jsonify }},
34
+ {% endif %}
35
+ {% if config._comments %}
36
+ "_comments": {{ config._comments | cc_jsonify }},
37
+ {% endif %}
38
+ {% if config._options %}
39
+ "_options": {{ config._options | cc_jsonify }},
40
+ {% endif %}
41
+ {% if config._collection_groups %}
42
+ "_collection_groups": {{ config._collection_groups | cc_jsonify }},
43
+ {% endif %}
44
+ {% if config._editor %}
45
+ "_editor": {
46
+ "default_path": {{ config._editor.default_path | cc_jsonify }}
47
+ },
48
+ {% endif %}
49
+ {% if config._source_editor %}
50
+ "_source_editor": {
51
+ "tab_size": {{ config._source_editor.tab_size | cc_jsonify }},
52
+ "show_gutter": {{ config._source_editor.show_gutter | cc_jsonify }},
53
+ "theme": {{ config._source_editor.theme | cc_jsonify }}
54
+ },
55
+ {% endif %}
56
+ "paths": {
57
+ "uploads": {{ config.uploads_dir | cc_jsonify }},
58
+ "data": {{ config.data_dir | cc_jsonify }},
59
+ "pages": "",
60
+ "collections": {{ config.collections_dir | cc_jsonify }},
61
+ "includes": {{ config.includes_dir | cc_jsonify }},
62
+ "layouts": {{ config.layouts_dir | cc_jsonify }}
63
+ },
64
+ {% if config._array_structures %}
65
+ "_array_structures": {{ config._array_structures | cc_jsonify: nil, 50 }},
66
+ {% endif %}
67
+ {% assign select_data = config | cc_select_data_jsonify %}
68
+ {% if select_data %}
69
+ "_select_data": {{ select_data }},
70
+ {% endif %}
71
+ {% if config.defaults %}
72
+ "defaults": {{ config.defaults | cc_jsonify }},
73
+ {% endif %}
74
+ "source": {{ config.source | replace: pwd, "" | cc_jsonify }}
75
+ }
@@ -0,0 +1,88 @@
1
+ {
2
+ "time": {{ site.time | date_to_xmlschema | cc_jsonify }},
3
+ "cloudcannon": {
4
+ "name": "cloudcannon-jekyll",
5
+ "version": {{ gem_version | cc_jsonify }}
6
+ },
7
+ "generator": {
8
+ "name": "jekyll",
9
+ "version": {{ jekyll.version | cc_jsonify }},
10
+ "environment": {{ jekyll.env | cc_jsonify }},
11
+ "metadata": {
12
+ "markdown": {{ site.markdown | cc_jsonify }},
13
+ "kramdown": {{ site.kramdown | cc_jsonify }},
14
+ "commonmark": {{ site.commonmark | cc_jsonify }}
15
+ }
16
+ },
17
+ {% if config.timezone -%}
18
+ "timezone": {{ config.timezone | cc_jsonify }},
19
+ {%- endif %}
20
+ "collections-config": {{ collections_config | cc_jsonify: 'collections' }},
21
+ "collections": {
22
+ "drafts": {{ drafts | cc_jsonify }}{% if site.collections.size > 0 %},{% endif %}
23
+ {%- for collection in site.collections -%}
24
+ "{{ collection.label | xml_escape }}": {{ collection.docs | cc_jsonify }}
25
+ {%- unless forloop.last %},{% endunless %}
26
+ {%- endfor -%}
27
+ },
28
+ "pages": {{ site.html_pages | cc_jsonify }},
29
+ "static-pages": {{ site.static_files | cc_static_files_jsonify }},
30
+ {% if site.cloudcannon.data.first -%}
31
+ "data": {
32
+ {%- assign data_seen = false %}
33
+ {%- for data in site.data %}
34
+ {%- assign key = data[0] %}
35
+ {%- if site.cloudcannon.data[key] %}
36
+ {%- if data_seen %},{% endif -%}
37
+ {{ data[0] | cc_jsonify }}: {{ data[1] | cc_jsonify }}
38
+ {%- assign data_seen = true %}
39
+ {%- endif %}
40
+ {%- endfor -%}
41
+ },
42
+ {% elsif site.cloudcannon.data -%}
43
+ "data": {{ site.data | cc_jsonify }},
44
+ {%- endif %}
45
+ {% if config.baseurl -%}
46
+ "base-url": {{ config.baseurl | cc_jsonify }},
47
+ {%- endif %}
48
+ {% if config._comments -%}
49
+ "_comments": {{ config._comments | cc_jsonify }},
50
+ {%- endif %}
51
+ {% if config._options -%}
52
+ "_options": {{ config._options | cc_jsonify }},
53
+ {%- endif %}
54
+ {% if config._collection_groups -%}
55
+ "_collection_groups": {{ config._collection_groups | cc_jsonify }},
56
+ {%- endif %}
57
+ {% if config._editor -%}
58
+ "_editor": {
59
+ "default_path": {{ config._editor.default_path | cc_jsonify }}
60
+ },
61
+ {%- endif %}
62
+ {% if config._source_editor -%}
63
+ "_source_editor": {
64
+ "tab_size": {{ config._source_editor.tab_size | cc_jsonify }},
65
+ "show_gutter": {{ config._source_editor.show_gutter | cc_jsonify }},
66
+ "theme": {{ config._source_editor.theme | cc_jsonify }}
67
+ },
68
+ {%- endif %}
69
+ "paths": {
70
+ "uploads": {{ config.uploads_dir | cc_jsonify }},
71
+ "data": {{ config.data_dir | cc_jsonify }},
72
+ "pages": "",
73
+ "collections": {{ config.collections_dir | cc_jsonify }},
74
+ "includes": {{ config.includes_dir | cc_jsonify }},
75
+ "layouts": {{ config.layouts_dir | cc_jsonify }}
76
+ },
77
+ {% if config._array_structures -%}
78
+ "_array_structures": {{ config._array_structures | cc_jsonify: nil, 50 }},
79
+ {%- endif %}
80
+ {% assign select_data = config | cc_select_data_jsonify -%}
81
+ {% if select_data -%}
82
+ "_select_data": {{ select_data }},
83
+ {%- endif %}
84
+ {% if config.defaults -%}
85
+ "defaults": {{ config.defaults | cc_jsonify }},
86
+ {%- endif %}
87
+ "source": {{ config.source | replace: pwd, "" | cc_jsonify }}
88
+ }
@@ -7,18 +7,17 @@ require_relative "reader"
7
7
  module CloudCannonJekyll
8
8
  # Generates JSON files containing build config and build output details
9
9
  class Generator < Jekyll::Generator
10
+ # Override the Jekyll::Plugin spaceship to push our plugin to the very end
10
11
  priority :lowest
12
+ def self.<=>(*)
13
+ 1
14
+ end
11
15
 
12
16
  def generate(site)
13
17
  @site = site
14
18
  @reader = Reader.new(@site)
15
19
 
16
- collections_config = @site.config["collections"]&.dup || {}
17
-
18
- # Workaround for empty collection configurations
19
- collections_config.each_key do |key|
20
- collections_config[key] ||= { "output" => false }
21
- end
20
+ collections_config = process_collections_config
22
21
 
23
22
  payload = @site.site_payload.merge({
24
23
  "gem_version" => CloudCannonJekyll::VERSION,
@@ -27,16 +26,27 @@ module CloudCannonJekyll
27
26
  drafts = add_blogging_config(collections_config)
28
27
  add_collection_paths(collections_config)
29
28
  add_data_config(collections_config)
29
+ add_legacy_explore_groups
30
30
 
31
- generate_file("config", payload.merge({
32
- "pwd" => Dir.pwd,
33
- "config" => @site.config,
34
- "collections" => collections_config,
31
+ generate_file("info", payload.merge({
32
+ "pwd" => Dir.pwd,
33
+ "config" => @site.config,
34
+ "collections_config" => collections_config,
35
+ "drafts" => drafts,
35
36
  }))
37
+ end
36
38
 
37
- generate_file("details", payload.merge({
38
- "drafts" => drafts,
39
- }))
39
+ def process_collections_config
40
+ collections = @site.config["collections"]&.dup || {}
41
+ cc_collections = @site.config.dig("cloudcannon", "collections")&.dup || {}
42
+
43
+ collections.each_key do |key|
44
+ # Workaround for empty collection configurations
45
+ defaults = collections[key] || { "output" => false }
46
+ cc_collections[key] = (cc_collections[key] || {}).merge(defaults)
47
+ end
48
+
49
+ cc_collections
40
50
  end
41
51
 
42
52
  def collections_dir
@@ -70,13 +80,13 @@ module CloudCannonJekyll
70
80
  collections_path = "#{collections_dir}/#{folder}".gsub(%r!\/+!, "/").sub(%r!^\/+!, "")
71
81
 
72
82
  collections_config["#{folder}/posts"] = posts_config.merge({
73
- "_path" => "#{collections_path}/_posts",
83
+ "path" => "#{collections_path}/_posts",
74
84
  })
75
85
 
76
86
  # Adding the category draft config like this isn't ideal, since you could have drafts
77
87
  # without posts, but it's a decent trade off vs looking for _drafts folders
78
88
  collections_config["#{folder}/drafts"] = posts_config.merge({
79
- "_path" => "#{collections_path}/_drafts",
89
+ "path" => "#{collections_path}/_drafts",
80
90
  })
81
91
 
82
92
  path
@@ -84,10 +94,17 @@ module CloudCannonJekyll
84
94
  end
85
95
  # rubocop:enable Metrics/AbcSize
86
96
 
97
+ # Support for the deprecated _explore configuration
98
+ def add_legacy_explore_groups
99
+ unless @site.config.key?("_collection_groups")
100
+ @site.config["_collection_groups"] = @site.config.dig("_explore", "groups")&.dup
101
+ end
102
+ end
103
+
87
104
  # Add data to collections config if raw data files exist
88
105
  def add_data_config(collections_config)
89
106
  data_files = @reader.read_data(data_dir)
90
- collections_config["data"] = { "_path" => data_dir } if data_files&.keys&.any?
107
+ collections_config["data"] = { "path" => data_dir } if data_files&.keys&.any?
91
108
  end
92
109
 
93
110
  # Add posts/drafts to collections config
@@ -95,9 +112,7 @@ module CloudCannonJekyll
95
112
  collections_config["posts"] = { "output" => true } if Jekyll::VERSION.start_with? "2."
96
113
  drafts = @reader.read_drafts(collections_dir)
97
114
 
98
- if collections_config.key?("posts")
99
- collections_config["drafts"] = collections_config["posts"]&.dup || {}
100
- elsif drafts.any?
115
+ if drafts.any? || (collections_config.key?("posts") && !collections_config.key?("drafts"))
101
116
  collections_config["drafts"] = {}
102
117
  end
103
118
 
@@ -109,12 +124,10 @@ module CloudCannonJekyll
109
124
  drafts
110
125
  end
111
126
 
112
- # Add _path to each collection config
127
+ # Add path to each collection config
113
128
  def add_collection_paths(collections_config)
114
129
  collections_config.each do |key, collection|
115
- next if collection.key?("_path")
116
-
117
- collection["_path"] = File.join(collections_dir, "_#{key}").sub(%r!^\/+!, "")
130
+ collection["path"] ||= File.join(collections_dir, "_#{key}").sub(%r!^\/+!, "")
118
131
  end
119
132
  end
120
133
 
@@ -63,7 +63,8 @@ module CloudCannonJekyll
63
63
  next if prevent.include? key
64
64
 
65
65
  prevent.push key
66
- "#{key.to_json}: #{JsonifyFilter.to_json(value, depth, max_depth)}"
66
+ next_max_depth = key == "_array_structures" ? 20 : max_depth
67
+ "#{key.to_json}: #{JsonifyFilter.to_json(value, depth, next_max_depth)}"
67
68
  end
68
69
 
69
70
  out.compact
@@ -106,17 +107,25 @@ module CloudCannonJekyll
106
107
  "{#{out.join(",")}}"
107
108
  end
108
109
 
110
+ def self.document_path(input)
111
+ collections_dir = input.site.config["collections_dir"] || ""
112
+ if input.collection && !collections_dir.empty?
113
+ "#{collections_dir}/#{input.relative_path}"
114
+ else
115
+ input.relative_path
116
+ end
117
+ end
118
+
109
119
  def self.document_to_json(input, depth, max_depth)
110
120
  prevent = %w(dir relative_path url collection)
111
121
 
112
122
  out = [
113
- "\"path\": #{JsonifyFilter.to_json(input.relative_path, depth, max_depth)}",
123
+ "\"path\": #{JsonifyFilter.to_json(JsonifyFilter.document_path(input), depth, max_depth)}",
114
124
  "\"url\": #{JsonifyFilter.to_json(input.url, depth, max_depth)}",
115
125
  ]
116
126
 
117
- collection = input.collection
118
- unless collection.nil?
119
- collection_json = JsonifyFilter.to_json(collection.label, depth, max_depth)
127
+ unless input.collection.nil?
128
+ collection_json = JsonifyFilter.to_json(input.collection.label, depth, max_depth)
120
129
  out.push("\"collection\": #{collection_json}")
121
130
  end
122
131
 
@@ -138,8 +147,9 @@ module CloudCannonJekyll
138
147
 
139
148
  def self.hash_to_json(input, depth, max_depth, key_swaps = {})
140
149
  out = input.map do |key, value|
150
+ next_max_depth = key == "_array_structures" ? 20 : max_depth
141
151
  string_key = (key_swaps[key] || key).to_s.to_json
142
- "#{string_key}: #{JsonifyFilter.to_json(value, depth, max_depth, key_swaps)}"
152
+ "#{string_key}: #{JsonifyFilter.to_json(value, depth, next_max_depth, key_swaps)}"
143
153
  end
144
154
 
145
155
  "{#{out.join(",")}}"
@@ -153,7 +163,7 @@ module CloudCannonJekyll
153
163
  baseurl show_dir_listing permalink paginate_path timezone quiet verbose defaults
154
164
  liquid kramdown title url description uploads_dir _comments _options _editor
155
165
  _explore _source_editor _array_structures maruku redcloth rdiscount redcarpet
156
- gems plugins)
166
+ gems plugins cloudcannon _collection_groups)
157
167
 
158
168
  out = input.map do |key, value|
159
169
  next unless value.is_a?(Array) || value.is_a?(Hash)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudCannonJekyll
4
- VERSION = "1.5.5"
4
+ VERSION = "2.0.0"
5
5
  end
data/script/ci-smoke-test CHANGED
@@ -8,4 +8,4 @@ set -ex
8
8
  JEKYLL_VERSION=2.4.0 bundle update && $(dirname "$0")/test &&
9
9
  JEKYLL_VERSION=3.0.0 bundle update && $(dirname "$0")/test &&
10
10
  JEKYLL_VERSION=3.8.5 bundle update && $(dirname "$0")/test &&
11
- JEKYLL_VERSION=4.1.1 bundle update && $(dirname "$0")/test
11
+ JEKYLL_VERSION=4.2.0 bundle update && $(dirname "$0")/test
data/script/release CHANGED
@@ -11,10 +11,10 @@ cd $(dirname "$0")/..
11
11
  rm -rf cloudcannon-jekyll-*.gem
12
12
  gem build -q cloudcannon-jekyll.gemspec
13
13
 
14
- # Ensure we're on the master branch
14
+ # Ensure we're on the main branch
15
15
 
16
- (git branch | grep -q '* master') || {
17
- echo "Only release from the master branch."
16
+ (git branch | grep -q '* main') || {
17
+ echo "Only release from the main branch."
18
18
  exit 1
19
19
  }
20
20
 
@@ -34,6 +34,6 @@ git fetch -t origin
34
34
  # Push tag and upload new gem
35
35
 
36
36
  git tag "$tag" &&
37
- git push origin master &&
37
+ git push origin main &&
38
38
  git push origin "$tag" &&
39
39
  gem push cloudcannon-jekyll-*.gem
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.5
4
+ version: 2.0.0
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-16 00:00:00.000000000 Z
11
+ date: 2021-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -120,12 +120,9 @@ files:
120
120
  - Rakefile
121
121
  - cloudcannon-jekyll.gemspec
122
122
  - lib/cloudcannon-jekyll.rb
123
- - lib/cloudcannon-jekyll/_cloudcannon/config-2.x.json
124
- - lib/cloudcannon-jekyll/_cloudcannon/config-3.0-4.x.json
125
- - lib/cloudcannon-jekyll/_cloudcannon/config.json
126
- - lib/cloudcannon-jekyll/_cloudcannon/details-2.x.json
127
- - lib/cloudcannon-jekyll/_cloudcannon/details-3.0-4.x.json
128
- - lib/cloudcannon-jekyll/_cloudcannon/details.json
123
+ - lib/cloudcannon-jekyll/_cloudcannon/info-2.x.json
124
+ - lib/cloudcannon-jekyll/_cloudcannon/info-3.0-4.x.json
125
+ - lib/cloudcannon-jekyll/_cloudcannon/info.json
129
126
  - lib/cloudcannon-jekyll/configuration.rb
130
127
  - lib/cloudcannon-jekyll/generator.rb
131
128
  - lib/cloudcannon-jekyll/jsonify-filter.rb
@@ -1,36 +0,0 @@
1
- {
2
- "time": {{ site.time | date_to_xmlschema | cc_jsonify }},
3
- "cloudcannon": {
4
- "name": "cloudcannon-jekyll",
5
- "version": {{ gem_version | cc_jsonify }}
6
- },
7
- {% if config.timezone %}"timezone": {{ config.timezone | cc_jsonify }},{% endif %}
8
- "include": {{ config.include | cc_jsonify }},
9
- "exclude": {{ config.exclude | cc_jsonify }},
10
- {% if config.baseurl %}"base-url": {{ config.baseurl | cc_jsonify }},{% endif %}
11
- "collections": {{ collections | cc_jsonify: 'collections' }},
12
- {% if config._comments %}"comments": {{ config._comments | cc_jsonify }},{% endif %}
13
- {% if config._options %}"input-options": {{ config._options | cc_jsonify }},{% endif %}
14
- {% if config.defaults %}"defaults": {{ config.defaults | cc_jsonify }},{% endif %}
15
- {% if config._editor %}"editor": {
16
- "default-path": {{ config._editor.default_path | cc_jsonify }}
17
- },{% endif %}
18
- {% if config._source_editor %}"source-editor": {
19
- "tab-size": {{ config._source_editor.tab_size | cc_jsonify }},
20
- "show-gutter": {{ config._source_editor.show_gutter | cc_jsonify }},
21
- "theme": {{ config._source_editor.theme | cc_jsonify }}
22
- },{% endif %}
23
- {% if config._explore %}"explore": {{ config._explore | cc_jsonify }},{% endif %}
24
- "paths": {
25
- "uploads": {{ config.uploads_dir | cc_jsonify }},
26
- "plugins": {{ config.plugins_dir | cc_jsonify }},
27
- "data": {{ config.data_dir | cc_jsonify }},
28
- "pages": "",
29
- "collections": {{ config.collections_dir | cc_jsonify }},
30
- "includes": {{ config.includes_dir | cc_jsonify }},
31
- "layouts": {{ config.layouts_dir | cc_jsonify }}
32
- },
33
- {% if config._array_structures %}"array-structures": {{ config._array_structures | cc_jsonify: nil, 20 }},{% endif %}
34
- {% assign select_data = config | cc_select_data_jsonify %}{% if select_data %}"select-data": {{ select_data }},{% endif %}
35
- "source": {{ config.source | replace: pwd, "" | cc_jsonify }}
36
- }
@@ -1,36 +0,0 @@
1
- {
2
- "time": {{ site.time | date_to_xmlschema | cc_jsonify }},
3
- "cloudcannon": {
4
- "name": "cloudcannon-jekyll",
5
- "version": {{ gem_version | cc_jsonify }}
6
- },
7
- {% if config.timezone %}"timezone": {{ config.timezone | cc_jsonify }},{% endif %}
8
- "include": {{ config.include | cc_jsonify }},
9
- "exclude": {{ config.exclude | cc_jsonify }},
10
- {% if config.baseurl %}"base-url": {{ config.baseurl | cc_jsonify }},{% endif %}
11
- "collections": {{ collections | cc_jsonify: 'collections' }},
12
- {% if config._comments %}"comments": {{ config._comments | cc_jsonify }},{% endif %}
13
- {% if config._options %}"input-options": {{ config._options | cc_jsonify }},{% endif %}
14
- {% if config.defaults %}"defaults": {{ config.defaults | cc_jsonify }},{% endif %}
15
- {% if config._editor %}"editor": {
16
- "default-path": {{ config._editor.default_path | cc_jsonify }}
17
- },{% endif %}
18
- {% if config._source_editor %}"source-editor": {
19
- "tab-size": {{ config._source_editor.tab_size | cc_jsonify }},
20
- "show-gutter": {{ config._source_editor.show_gutter | cc_jsonify }},
21
- "theme": {{ config._source_editor.theme | cc_jsonify }}
22
- },{% endif %}
23
- {% if config._explore %}"explore": {{ config._explore | cc_jsonify }},{% endif %}
24
- "paths": {
25
- "uploads": {{ config.uploads_dir | cc_jsonify }},
26
- "plugins": {{ config.plugins_dir | cc_jsonify }},
27
- "data": {{ config.data_dir | cc_jsonify }},
28
- "pages": "",
29
- "collections": {{ config.collections_dir | cc_jsonify }},
30
- "includes": {{ config.includes_dir | cc_jsonify }},
31
- "layouts": {{ config.layouts_dir | cc_jsonify }}
32
- },
33
- {% if config._array_structures %}"array-structures": {{ config._array_structures | cc_jsonify: nil, 20 }},{% endif %}
34
- {% assign select_data = config | cc_select_data_jsonify %}{% if select_data %}"select-data": {{ select_data }},{% endif %}
35
- "source": {{ config.source | replace: pwd, "" | cc_jsonify }}
36
- }
@@ -1,57 +0,0 @@
1
- {
2
- "time": {{ site.time | date_to_xmlschema | cc_jsonify }},
3
- "cloudcannon": {
4
- "name": "cloudcannon-jekyll",
5
- "version": {{ gem_version | cc_jsonify }}
6
- },
7
- {% if config.timezone -%}
8
- "timezone": {{ config.timezone | cc_jsonify }},
9
- {%- endif %}
10
- "include": {{ config.include | cc_jsonify }},
11
- "exclude": {{ config.exclude | cc_jsonify }},
12
- {% if config.baseurl -%}
13
- "base-url": {{ config.baseurl | cc_jsonify }},
14
- {%- endif %}
15
- "collections": {{ collections | cc_jsonify: 'collections' }},
16
- {% if config._comments -%}
17
- "comments": {{ config._comments | cc_jsonify }},
18
- {%- endif %}
19
- {% if config._options -%}
20
- "input-options": {{ config._options | cc_jsonify }},
21
- {%- endif %}
22
- {% if config.defaults -%}
23
- "defaults": {{ config.defaults | cc_jsonify }},
24
- {%- endif %}
25
- {% if config._editor -%}
26
- "editor": {
27
- "default-path": {{ config._editor.default_path | cc_jsonify }}
28
- },
29
- {%- endif %}
30
- {% if config._source_editor -%}
31
- "source-editor": {
32
- "tab-size": {{ config._source_editor.tab_size | cc_jsonify }},
33
- "show-gutter": {{ config._source_editor.show_gutter | cc_jsonify }},
34
- "theme": {{ config._source_editor.theme | cc_jsonify }}
35
- },
36
- {%- endif %}
37
- {% if config._explore -%}
38
- "explore": {{ config._explore | cc_jsonify }},
39
- {%- endif %}
40
- "paths": {
41
- "uploads": {{ config.uploads_dir | cc_jsonify }},
42
- "plugins": {{ config.plugins_dir | cc_jsonify }},
43
- "data": {{ config.data_dir | cc_jsonify }},
44
- "pages": "",
45
- "collections": {{ config.collections_dir | cc_jsonify }},
46
- "includes": {{ config.includes_dir | cc_jsonify }},
47
- "layouts": {{ config.layouts_dir | cc_jsonify }}
48
- },
49
- {% if config._array_structures -%}
50
- "array-structures": {{ config._array_structures | cc_jsonify: nil, 20 }},
51
- {%- endif %}
52
- {% assign select_data = config | cc_select_data_jsonify -%}
53
- {% if select_data -%}
54
- "select-data": {{ select_data }},
55
- {%- endif %}
56
- "source": {{ config.source | replace: pwd, "" | cc_jsonify }}
57
- }
@@ -1,28 +0,0 @@
1
- {
2
- "time": {{ site.time | date_to_xmlschema | cc_jsonify }},
3
- "cloudcannon": {
4
- "name": "cloudcannon-jekyll",
5
- "version": {{ gem_version | cc_jsonify }}
6
- },
7
- "generator": {
8
- "name": "jekyll",
9
- "version": {{ jekyll.version | cc_jsonify }},
10
- "environment": {{ jekyll.env | cc_jsonify }},
11
- "metadata": {
12
- "markdown": {{ site.markdown | cc_jsonify }},
13
- "kramdown": {{ site.kramdown | cc_jsonify }},
14
- "commonmark": {{ site.commonmark | cc_jsonify }}
15
- }
16
- },{% if site.cloudcannon.data.first %}{% assign data_seen = false %}
17
- "data": {
18
- {% for data in site.data %}{% assign key = data[0] %}{% if site.cloudcannon.data[key] %}{% if data_seen %},{% endif %}{{ data[0] | cc_jsonify }}: {{ data[1] | cc_jsonify }}{% assign data_seen = true %}{% endif %}{% endfor %}},
19
- {% elsif site.cloudcannon.data %}"data": {{ site.data | cc_jsonify }},{% endif %}
20
- "collections": {
21
- "drafts": {{ drafts | cc_jsonify }},
22
- "posts": {{ site.posts | reverse | cc_jsonify }}{% if site.collections.size > 0 %},{% endif %}
23
- {% for collection in site.collections %}"{{ collection[0] | xml_escape }}": {{ collection[1].docs | cc_jsonify }}{% unless forloop.last %},{% endunless %}
24
- {% endfor %}
25
- },
26
- "pages": {{ site.pages | cc_jsonify }},
27
- "static-pages": {{ site.static_files | cc_static_files_jsonify }}
28
- }
@@ -1,27 +0,0 @@
1
- {
2
- "time": {{ site.time | date_to_xmlschema | cc_jsonify }},
3
- "cloudcannon": {
4
- "name": "cloudcannon-jekyll",
5
- "version": {{ gem_version | cc_jsonify }}
6
- },
7
- "generator": {
8
- "name": "jekyll",
9
- "version": {{ jekyll.version | cc_jsonify }},
10
- "environment": {{ jekyll.env | cc_jsonify }},
11
- "metadata": {
12
- "markdown": {{ site.markdown | cc_jsonify }},
13
- "kramdown": {{ site.kramdown | cc_jsonify }},
14
- "commonmark": {{ site.commonmark | cc_jsonify }}
15
- }
16
- },{% if site.cloudcannon.data.first %}{% assign data_seen = false %}
17
- "data": {
18
- {% for data in site.data %}{% assign key = data[0] %}{% if site.cloudcannon.data[key] %}{% if data_seen %},{% endif %}{{ data[0] | cc_jsonify }}: {{ data[1] | cc_jsonify }}{% assign data_seen = true %}{% endif %}{% endfor %}},
19
- {% elsif site.cloudcannon.data %}"data": {{ site.data | cc_jsonify }},{% endif %}
20
- "collections": {
21
- "drafts": {{ drafts | cc_jsonify }}{% if site.collections.size > 0 %},{% endif %}
22
- {% for collection in site.collections %}"{{ collection.label | xml_escape }}": {{ collection.docs | cc_jsonify }}{% unless forloop.last %},{% endunless %}
23
- {% endfor %}
24
- },
25
- "pages": {{ site.pages | cc_jsonify }},
26
- "static-pages": {{ site.static_files | cc_static_files_jsonify }}
27
- }
@@ -1,41 +0,0 @@
1
- {
2
- "time": {{ site.time | date_to_xmlschema | cc_jsonify }},
3
- "cloudcannon": {
4
- "name": "cloudcannon-jekyll",
5
- "version": {{ gem_version | cc_jsonify }}
6
- },
7
- "generator": {
8
- "name": "jekyll",
9
- "version": {{ jekyll.version | cc_jsonify }},
10
- "environment": {{ jekyll.env | cc_jsonify }},
11
- "metadata": {
12
- "markdown": {{ site.markdown | cc_jsonify }},
13
- "kramdown": {{ site.kramdown | cc_jsonify }},
14
- "commonmark": {{ site.commonmark | cc_jsonify }}
15
- }
16
- },
17
- {% if site.cloudcannon.data.first -%}
18
- "data": {
19
- {%- assign data_seen = false %}
20
- {%- for data in site.data %}
21
- {%- assign key = data[0] %}
22
- {%- if site.cloudcannon.data[key] %}
23
- {%- if data_seen %},{% endif -%}
24
- {{ data[0] | cc_jsonify }}: {{ data[1] | cc_jsonify }}
25
- {%- assign data_seen = true %}
26
- {%- endif %}
27
- {%- endfor -%}
28
- },
29
- {% elsif site.cloudcannon.data -%}
30
- "data": {{ site.data | cc_jsonify }},
31
- {%- endif %}
32
- "collections": {
33
- "drafts": {{ drafts | cc_jsonify }}{% if site.collections.size > 0 %},{% endif %}
34
- {%- for collection in site.collections -%}
35
- "{{ collection.label | xml_escape }}": {{ collection.docs | cc_jsonify }}
36
- {%- unless forloop.last %},{% endunless %}
37
- {%- endfor -%}
38
- },
39
- "pages": {{ site.pages | cc_jsonify }},
40
- "static-pages": {{ site.static_files | cc_static_files_jsonify }}
41
- }