cloudcannon-jekyll 4.0.0 → 4.0.2

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: c513d1410254af59fed1d369d9852c77b0aa59474cf374f538a6557e5d0445f3
4
- data.tar.gz: bfdcbdf270b02d3ab9f5b8c869650f46c4f8eb06a73f30f821fbeb9611fe0480
3
+ metadata.gz: 787bae32d731d9cae9e4449fb385f7fed6f9457e682c78830c291ecf79294b2c
4
+ data.tar.gz: 29d1786c961cd6d2c6d12bc34cd2259c1389c84e139a473ab5123bf76f8a843a
5
5
  SHA512:
6
- metadata.gz: 9dbf04c9447ce64b41394dfc7ed33924f089542506a054a46da581940efe44be5e2f7bca61014855dacb62efc46d86bdc3e9ac37e470f7c94f411aeec54bf05c
7
- data.tar.gz: 9993038e810b3509f39aeadb41e77d2b29635481469c331daed39ce0154b5a8c2320fed85c301fc182088de93eb6a74b3f77eb5bd1c5ce574c65017567f4e811
6
+ metadata.gz: 9b019fcb347c49cbbf5ec77553031c4a81d1820bbf96a43201b310275608847e7ccfd06e46950461ee355c579dbc2cecad455b08707759b1db6d8ad6e1af85a6
7
+ data.tar.gz: f0bbbe7ada0c89c63fe115b282a9313d3f577d8e6c140f101d770df72300dd6806bea2ca4f2d7c4f2feaa3d3e46c92fc0b4cf7cc20bcaea1d09e565e3dce8970
data/HISTORY.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 4.0.2
2
+
3
+ * Prevent reading PageWithoutAFile documents
4
+
5
+ # 4.0.1
6
+
7
+ * Fix nested post and draft collection mapping
8
+
1
9
  # 4.0.0
2
10
 
3
11
  * Assign files to collections based on paths rather than matching Jekyll collection
@@ -22,6 +22,16 @@ module CloudCannonJekyll
22
22
  @split_drafts = group_by_category_folder(all_drafts, 'drafts')
23
23
  end
24
24
 
25
+ def generate_collections_config_path(key)
26
+ if key.end_with?("/posts")
27
+ File.join(@collections_dir, key.sub(/\/posts$/, "/_posts"))
28
+ elsif key.end_with?("/drafts")
29
+ File.join(@collections_dir, key.sub(/\/drafts$/, "/_drafts"))
30
+ else
31
+ File.join(@collections_dir, "_#{key}")
32
+ end
33
+ end
34
+
25
35
  def generate_collections_config
26
36
  collections = @site.config['collections'] || {}
27
37
  collections_config = @config['collections_config'] || {}
@@ -62,7 +72,7 @@ module CloudCannonJekyll
62
72
 
63
73
  processed['output'] ||= false
64
74
  processed['auto_discovered'] = !collections_config.key?(key)
65
- processed['path'] ||= File.join(@collections_dir, "_#{key}")
75
+ processed['path'] ||= generate_collections_config_path(key)
66
76
  processed['path'] = processed['path'].sub(%r{^/+}, '')
67
77
 
68
78
  Config.rename_legacy_collection_config_keys(processed)
@@ -287,7 +297,9 @@ module CloudCannonJekyll
287
297
  end
288
298
 
289
299
  def allowed_document?(doc)
290
- if doc.instance_of?(Jekyll::Page)
300
+ if !IS_JEKYLL_2_X_X && !IS_JEKYLL_3_04_X && doc.instance_of?(Jekyll::PageWithoutAFile)
301
+ false
302
+ elsif doc.instance_of?(Jekyll::Page)
291
303
  allowed_page?(doc)
292
304
  elsif doc.instance_of?(Jekyll::StaticFile)
293
305
  allowed_static_file?(doc)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudCannonJekyll
4
- VERSION = '4.0.0'
4
+ VERSION = '4.0.2'
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: 4.0.0
4
+ version: 4.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: 2023-02-23 00:00:00.000000000 Z
11
+ date: 2023-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll