bookshop-array-structures 1.4.4 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bookshop-array-structures.rb +5 -4
- data/lib/bookshop-array-structures/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: d9c01f665a4a513af227820d73178c650ada11a5083c4d2c6870dd7f601bae0b
|
4
|
+
data.tar.gz: d2962ed392eed80038c4be7bdf3e391d185cc992cc33913276eea71f82827544
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4542176f7a9b5df942c7c492a1c0ab8bb5f8f5b14bdcd484fe66ce6c4bc9e360fa8d25b610533540073e087fdf722a9e31b18c4e57d4f1da3d6ea5e541e248ba
|
7
|
+
data.tar.gz: 652a9618a21a82dbfe11f9ddfc1dfbb5fcc66dea3b5a6a6db174b621ffd81e9f3b80241b9b4e4762383dc597b0ab042b4e6cd52cc7f86b0462b10110ead032e8
|
@@ -8,8 +8,9 @@ module Bookshop
|
|
8
8
|
return basename.split("-").map(&:capitalize).join(" ")
|
9
9
|
end
|
10
10
|
|
11
|
-
def self.transform_component(component, site)
|
11
|
+
def self.transform_component(path, component, site)
|
12
12
|
result = {}
|
13
|
+
result['_component_type'] = path.split(".").first;
|
13
14
|
component.each_pair { |storyname, story|
|
14
15
|
story.each_pair {|key, value|
|
15
16
|
if result.has_key?(key) && storyname != "defaults"
|
@@ -24,7 +25,7 @@ module Bookshop
|
|
24
25
|
}
|
25
26
|
|
26
27
|
label = new_key.split("_").map(&:capitalize).join(" ")
|
27
|
-
if site.config["_array_structures"][new_key]["values"].select{|value| value
|
28
|
+
if site.config["_array_structures"][new_key]["values"].select{|value| value["label"] == label}.length > 0
|
28
29
|
next
|
29
30
|
end
|
30
31
|
site.config["_array_structures"][new_key]["values"].push({
|
@@ -73,7 +74,7 @@ module Bookshop
|
|
73
74
|
component = TomlRB.load_file(base_path + f)
|
74
75
|
site.config["_array_structures"]["components"]["values"].push({
|
75
76
|
"label" => get_story_name(f),
|
76
|
-
"value" => transform_component(component, site)
|
77
|
+
"value" => transform_component(f, component, site)
|
77
78
|
})
|
78
79
|
end
|
79
80
|
end
|
@@ -82,4 +83,4 @@ end
|
|
82
83
|
|
83
84
|
Jekyll::Hooks.register :site, :after_init do |site|
|
84
85
|
Bookshop::ArrayStructures.build_array_structures(site)
|
85
|
-
end
|
86
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookshop-array-structures
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tate
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|