jekyll-bookshop 2.0.0.pre.beta.13 → 2.0.0.pre.beta.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-bookshop/site-data.rb +1 -1
- data/lib/jekyll-bookshop/tags/browser-tag.rb +18 -1
- data/lib/jekyll-bookshop/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: 34f967a604fa914abeedd316ebb4e73836dcfe4b99797b066beca60bdbdd18ec
|
4
|
+
data.tar.gz: c32c7510908ceb67c61c5677b1262bd55430f1bb20b1cfaaefbd725ceda62d89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 567bc589f7b0f737d56301723a36dd4d8e0d6e6794f8a44f254393f2d1bcebc0799868fc2a8ec7448aba8270ca6968967894e4ff90e2ff6455a115b1b399939c
|
7
|
+
data.tar.gz: 20910536649f1cc6eff27da753cd34f26e12bac2c98d41bdb16eecb41aa0a40e3a216caa8be0752b8fdf73ba0f86121109b60aef8b7520b47f4a211d3f995a3e
|
@@ -46,7 +46,7 @@ module JekyllBookshop
|
|
46
46
|
|
47
47
|
page.output = page.output.gsub(
|
48
48
|
%r!bookshop_browser_site_data = null!,
|
49
|
-
"bookshop_browser_site_data = #{@site.data["_bookshop_site_data"].to_json}"
|
49
|
+
"bookshop_browser_site_data = #{@site.data["_bookshop_site_data"].to_json.gsub(%r!</script!i, "<\\/script")}"
|
50
50
|
)
|
51
51
|
end
|
52
52
|
@site.data["_bookshop_data_pages"] = nil
|
@@ -7,9 +7,26 @@ module JekyllBookshop
|
|
7
7
|
@host = markup.strip
|
8
8
|
end
|
9
9
|
|
10
|
+
def self.transformHostString(host)
|
11
|
+
case
|
12
|
+
when host =~ %r!^:\d+$!
|
13
|
+
"http://localhost#{host}/bookshop.js"
|
14
|
+
when host =~ %r!^\d+$!
|
15
|
+
"http://localhost:#{host}/bookshop.js"
|
16
|
+
when host =~ %r!^localhost:\d+$!
|
17
|
+
"http://#{host}/bookshop.js"
|
18
|
+
when host =~ %r!^/!
|
19
|
+
host
|
20
|
+
else
|
21
|
+
"//#{host}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
10
25
|
def render(context)
|
11
26
|
return unless @host
|
12
27
|
|
28
|
+
host = BrowserTag.transformHostString(@host)
|
29
|
+
|
13
30
|
site = context.registers[:site]
|
14
31
|
page = context.registers[:page]
|
15
32
|
|
@@ -20,7 +37,7 @@ module JekyllBookshop
|
|
20
37
|
|
21
38
|
"<div data-bookshop-browser></div>
|
22
39
|
<script>window.bookshop_browser_site_data = null;</script>
|
23
|
-
<script src=\"
|
40
|
+
<script src=\"#{host}\"></script>
|
24
41
|
<script>
|
25
42
|
window.BookshopBrowser = new window.BookshopBrowserClass({
|
26
43
|
globals: [window.bookshop_browser_site_data]
|
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.beta.
|
4
|
+
version: 2.0.0.pre.beta.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CloudCannon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|