cloudcannon-jekyll 1.5.7 → 1.6.0

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: 3054f2fad52e25c68f74efaea8d7adaf4186eb3c553a1e4f0a8b0d8b7502a5dd
4
- data.tar.gz: e4826cd5492f8081a32d6886b4d039ca65f464c8833d8653716a715c07112fcd
3
+ metadata.gz: 10ce07fce474de172ceafec1ecbe0a0d4e6d012d2357befc0cef41e2418a992e
4
+ data.tar.gz: 418f38e206327042999eca17c901477e7fd864bce425a5410a6b49cc503760f3
5
5
  SHA512:
6
- metadata.gz: a73fd3d4cf8f9a244ac744d05dabc6361972d9fbe669dfcfe13f651bfc1d6e71c6b5e5c1c7b172f46158fb9983df788d796dbe6da32fdb2d9a7ca440907f00fa
7
- data.tar.gz: 2bfb1f2757052b0c30b2052765bd3ecedc7c1d8d5ee9c7eceeccad9a358facce4f1376b0a710aa07bc4d9dbe2968131149a11cd597f14351ccab087b12772261
6
+ metadata.gz: db5ebdba978110b1b312dafb9b1e3f9928edd4259b9095af266a2be1964bdf3028a0fe303080353b8a5a18685ae52705dd630cf16285e1be9f7c129c328fc525
7
+ data.tar.gz: 76f36521f6b0888b90be9e0a071bd5c3258e97ec2623d996ebf3a5cdc7f0f3f771e35bf6b0f258f4e5654538e7dcc17524f32fd37223414b0cb5ffbf8f24700d
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/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.6.0
2
+
3
+ * Add `collections_dir` to details collection item paths
4
+
1
5
  # 1.5.7
2
6
 
3
7
  * Fix pages collection clash with built-in pages
@@ -106,17 +106,25 @@ module CloudCannonJekyll
106
106
  "{#{out.join(",")}}"
107
107
  end
108
108
 
109
+ def self.document_path(input)
110
+ collections_dir = input.site.config["collections_dir"] || ""
111
+ if input.collection && !collections_dir.empty?
112
+ "#{collections_dir}/#{input.relative_path}"
113
+ else
114
+ input.relative_path
115
+ end
116
+ end
117
+
109
118
  def self.document_to_json(input, depth, max_depth)
110
119
  prevent = %w(dir relative_path url collection)
111
120
 
112
121
  out = [
113
- "\"path\": #{JsonifyFilter.to_json(input.relative_path, depth, max_depth)}",
122
+ "\"path\": #{JsonifyFilter.to_json(JsonifyFilter.document_path(input), depth, max_depth)}",
114
123
  "\"url\": #{JsonifyFilter.to_json(input.url, depth, max_depth)}",
115
124
  ]
116
125
 
117
- collection = input.collection
118
- unless collection.nil?
119
- collection_json = JsonifyFilter.to_json(collection.label, depth, max_depth)
126
+ unless input.collection.nil?
127
+ collection_json = JsonifyFilter.to_json(input.collection.label, depth, max_depth)
120
128
  out.push("\"collection\": #{collection_json}")
121
129
  end
122
130
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudCannonJekyll
4
- VERSION = "1.5.7"
4
+ VERSION = "1.6.0"
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.7
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - CloudCannon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-29 00:00:00.000000000 Z
11
+ date: 2021-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll