sutty-liquid 0.12.4 → 0.13.0rc1
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
- checksums.yaml.gz.sig +0 -0
- data/lib/jekyll/filters/arrays.rb +11 -0
- data/lib/jekyll/filters/yaml_to_scss.rb +16 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8386ce2917bd5efea66015e2d1109f4337833cf5544b3458347ee1de05610d2
|
4
|
+
data.tar.gz: def426330c8040cbf4067019f554443d68f550f18a9a848ed452fa8f98f17008
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a352e1c1c1d4d5cd0d5d13a931ea7372d5a36131d9d7067e8807067418c45a85763868fa9ea582b5d88b7cfcf5d28d36f1defa70d3345f077a832c1a39ff0cc3
|
7
|
+
data.tar.gz: c57512b63efdf0280a21d457ab4f506c0d1fb1490bf571aee1a7c299b151dfc3bf5f188968f70e53dff941b2a9763ffc26973c01ef29cc5cd15b7dedc71ec8f5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -17,6 +17,17 @@ module Jekyll
|
|
17
17
|
input.sample(amount)
|
18
18
|
end
|
19
19
|
|
20
|
+
# Flattens nested arrays
|
21
|
+
#
|
22
|
+
# @example
|
23
|
+
# {{ site.posts | map: 'categories' | flatten: 1 }}
|
24
|
+
# @param input [any]
|
25
|
+
# @param level [Integer]
|
26
|
+
# @return [Array]
|
27
|
+
def flatten(input, level = nil)
|
28
|
+
[input].flatten(level)
|
29
|
+
end
|
30
|
+
|
20
31
|
# Join arrays or append item to array
|
21
32
|
#
|
22
33
|
# @example
|
@@ -18,6 +18,7 @@ module Jekyll
|
|
18
18
|
# @return [String]
|
19
19
|
def yaml_to_scss(yaml, schema = yaml)
|
20
20
|
yaml = yaml.to_h if yaml.is_a? Jekyll::Drops::DocumentDrop
|
21
|
+
yaml = {} if yaml.nil?
|
21
22
|
|
22
23
|
unless yaml.is_a? Hash
|
23
24
|
raise Liquid::ArgumentError, "#{yaml.inspect} needs to be a Hash" if @context.strict_filters
|
@@ -33,8 +34,22 @@ module Jekyll
|
|
33
34
|
keys = keys - reject_keys
|
34
35
|
end
|
35
36
|
|
37
|
+
keys.each do |key|
|
38
|
+
yaml[key] ||= nil
|
39
|
+
end
|
40
|
+
|
36
41
|
yaml.slice(*keys).map do |key, value|
|
37
|
-
|
42
|
+
if value.nil?
|
43
|
+
Jekyll.logger.warn 'YAML to SCSS:', "#{key} getting default value from schema"
|
44
|
+
|
45
|
+
value = schema.dig(key, 'default', site.locale)
|
46
|
+
value ||= schema.dig(key, 'default', site.default_locale)
|
47
|
+
end
|
48
|
+
|
49
|
+
if value.nil? || (value.respond_to?(:empty?) && value.empty?)
|
50
|
+
Jekyll.logger.warn 'YAML to SCSS:', "#{key} value is nil or empty"
|
51
|
+
next
|
52
|
+
end
|
38
53
|
|
39
54
|
escape = schema[key].is_a?(Hash) && %w[image file].include?(schema.dig(key, 'type'))
|
40
55
|
key = key_to_scss key
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sutty-liquid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
cpurTQHNJfL/ah+9dYbgDXdG5HAAjRMAsWSvERw95YdN9XzQZCdUk5wUs+A6cNtO
|
36
36
|
AZZUMTVYNx8JqUeemxlXBRjsD/s=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2025-
|
38
|
+
date: 2025-08-24 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: fast_blank
|
@@ -217,9 +217,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
217
217
|
version: 2.7.0
|
218
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
|
-
- - "
|
220
|
+
- - ">"
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version:
|
222
|
+
version: 1.3.1
|
223
223
|
requirements: []
|
224
224
|
rubygems_version: 3.3.27
|
225
225
|
signing_key:
|
metadata.gz.sig
CHANGED
Binary file
|