jekyll-bookshop 2.0.0.pre.alpha.10 → 2.0.0.pre.alpha.15

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: f916f25db1483e458aa21fa59eb9c51ffa634ea125b5f9815f16720577e96353
4
- data.tar.gz: 7038f5c2f29d3a4cf75e558ae9dffbd3d6843e92e16e91c812e61a3394f973c9
3
+ metadata.gz: f13abc99b301d86c40d59d436c03b6ffecf219c2fb970fb58bc60e6384ebb1cf
4
+ data.tar.gz: 3854362932a2ce2f3e968ad417530e16721fd7d3a3baa805bf4f77145f30fc80
5
5
  SHA512:
6
- metadata.gz: 012d8267c8a87c6b7671cd58ca66813313acdf001c86913ba7b9249c243a72be6c97aaf7b687a0d1b789729355f711aa431bf020a6dd8b19966f32489f16ac8c
7
- data.tar.gz: 674d6d702c6277734c2e4897681514082cf81fd597af2bbf78870350007266efe64861e8c048cf164e84e616ba2b7dfdf29ecb4907508cf871d5ae3ca8e91e58
6
+ metadata.gz: 83ced29aebf52c3c959ba3feaa6c28e1c406f2195693ac3b85730c8904cfa163b5d09682bc935ca0681028f342d74713bfa190fe7bc1e2dcfdf101edd7512721
7
+ data.tar.gz: '08d1f87ff6e228ea678ddb6cbb70982bd0fc413ffad3f8a10c598df22bbd626a95c526e56f5b1bdea2377860815e9f75ac82543e274fdf474bb24d7aa95f39a6'
@@ -14,11 +14,12 @@ module JekyllBookshop
14
14
  param_hash = {}
15
15
  new_params = {}
16
16
 
17
- template = params["__template"]
18
- return Liquid::Template.parse(template).render(context) if template
17
+ is_template = params.key?("__template") || params.key?("__template_code")
18
+ template = params["__template"] || params["__template_code"] || ""
19
+ return Liquid::Template.parse(template).render(context) if is_template
19
20
 
20
- array_template = params["__array_template"]
21
- if array_template
21
+ array_template = params["__array_template"] || ""
22
+ if params.key? "__array_template"
22
23
  # We're adding a new root scope here and then removing it.
23
24
  # Who knows why, but assign and capture always add to the root scope.
24
25
  # Which is why this is hacked in, instead of using context.stack 🤷‍♂️
@@ -49,7 +50,8 @@ module JekyllBookshop
49
50
  end
50
51
 
51
52
  params.each_pair do |param, value|
52
- if param.end_with? "_template"
53
+ is_template = param.end_with?("_template") || param.end_with?("_template_code")
54
+ if is_template
53
55
  param_root, param_remainder = param.split('.', 2)
54
56
  param_hash[param_root] ||= {}
55
57
  param_hash[param_root][param_remainder] = value
@@ -76,7 +78,9 @@ module JekyllBookshop
76
78
  end
77
79
 
78
80
  params.delete('bind')
81
+ context.scopes.push({}) # Do all expansion in an ephemeral root scope
79
82
  params = expand_param_templates(params, context, "")
83
+ context.scopes.pop()
80
84
 
81
85
  params
82
86
  end
@@ -128,13 +132,13 @@ module JekyllBookshop
128
132
  end
129
133
 
130
134
  bookshop_scss_files = bookshop_scss_files&.collect do |file|
131
- "@import '#{file}';"
135
+ "@import \"#{file}\";"
132
136
  end
133
137
 
134
138
  output_css = if Jekyll.env == "production"
135
139
  bookshop_scss_files.join("\n")
136
140
  else
137
- "html:not([data-bookshop-hmr]) {
141
+ "@media all, bookshop {
138
142
  #{bookshop_scss_files.join("\n")}
139
143
  }"
140
144
  end
@@ -1,3 +1,3 @@
1
1
  module JekyllBookshop
2
- VERSION = "2.0.0.pre.alpha.10"
2
+ VERSION = "2.0.0.pre.alpha.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-bookshop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.alpha.10
4
+ version: 2.0.0.pre.alpha.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - CloudCannon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-13 00:00:00.000000000 Z
11
+ date: 2021-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll