jekyll-svelte-slabs 0.0.4 → 0.0.10

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: db84f3469a649ec9c6b49fd7251b7c70103c1172a35277c9af1bdcb8e9aecb81
4
- data.tar.gz: 93689a31bca7742554559864c8f909bd49999ee5265f3c893796aa9f889e6e67
3
+ metadata.gz: 46209b41ae43688dc1283cb695ea7ca36481363867aa0832495e4cdad886e03e
4
+ data.tar.gz: ce667eab704270985620ac6cb08d7005c6df825a680c3ed6686ced93902657c1
5
5
  SHA512:
6
- metadata.gz: 398cf87b7c2f1a1f5626943c4713d6471135d468bfba61f6911062b2ef7bb311bbb6f948a94819f7330943130826f7cba3e37de0faa56f1434246e396695ec07
7
- data.tar.gz: 0db8c430fb82a25ee89da3e02e4295d469735b976713565dce7aeaa4cbc71d6be2c2d790b0d0d86a843d4cdad95656a8e41a10bf9dba335a16c166deaa5a3cb0
6
+ metadata.gz: 2abeb3045705a310a7cd9c3be12a938352e950ab81489441b7dfd927dbead751ce8eb7af4c58e43640049421020fbbfa8b29c844895c9a5be57d5ea681e8bb1f
7
+ data.tar.gz: e88b546aba369c113104c0e4dfcf385525ce5da493aad0db64ff3fe4148233252ee7d8d6382cd69ef3d2f3804bf6690413da5787518ae3fbea5ca71b6bacc1f4
@@ -135,10 +135,15 @@ module JekyllSvelteSlabs
135
135
  # site = context.registers[:site]
136
136
  # puts site
137
137
 
138
+ slab_config = context['site']['svelte_slabs'] || {}
139
+ method = slab_config['method'] || "window"
140
+
138
141
  file = render_variable(context) || @file
139
142
  validate_file_name(file)
140
143
 
141
144
  svelte_data = @params ? parse_params(context).to_json : "{}"
145
+ svelte_data = "\"#{Base64.strict_encode64(svelte_data)}\"" if method == "window_b"
146
+ svelte_data = "`#{svelte_data.gsub("<", "&rawlt;").gsub("`", "\`")}`" if method == "window_e"
142
147
  endpoint = Digest::MD5.hexdigest(svelte_data)
143
148
 
144
149
  <<~MSG
@@ -146,7 +151,7 @@ module JekyllSvelteSlabs
146
151
  window.svelteSlabs = window.svelteSlabs || {};
147
152
  window.svelteSlabs["#{endpoint}"] = #{svelte_data};
148
153
  </script>
149
- <div data-svelte-slab="#{file}" data-svelte-slab-props="window:#{endpoint}">
154
+ <div data-svelte-slab="#{file}" data-svelte-slab-props="#{method}:#{endpoint}">
150
155
  #{text}
151
156
  </div>
152
157
  MSG
@@ -1,3 +1,3 @@
1
1
  module JekyllSvelteSlabs
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-svelte-slabs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liam Bigelow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-17 00:00:00.000000000 Z
11
+ date: 2021-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll