jekyll-bookshop 2.0.0.pre.beta.12 → 2.0.0.pre.beta.16
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/tags/browser-tag.rb +18 -2
- 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: ae3691f75c45319beafded876f14bdbe63f232a9eae5c0cbc0e1a35ca3786939
|
4
|
+
data.tar.gz: 20b6ce171d8b1acef0dd87140e2055e35cc5cf561896973f48ec880b13a9e48b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2f9059a3d69a240c278e8f9da748cae15c87617393c7af9bd18a80ddca796dcd327540f74da2b58609d46031f4c278a2287196b66a9a74477dfc4a8aa2a81fa
|
7
|
+
data.tar.gz: 1b50ca6210053beee4ec0c0b27eafaf90da499264501d90a117ce72e27b9c4e33bf2320c853f54ca1dbc99f66e643813158379251ad4d8c065a1d73a5a6b307d
|
@@ -7,9 +7,25 @@ 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)
|
13
29
|
|
14
30
|
site = context.registers[:site]
|
15
31
|
page = context.registers[:page]
|
@@ -21,7 +37,7 @@ module JekyllBookshop
|
|
21
37
|
|
22
38
|
"<div data-bookshop-browser></div>
|
23
39
|
<script>window.bookshop_browser_site_data = null;</script>
|
24
|
-
<script src=\"
|
40
|
+
<script src=\"#{host}\"></script>
|
25
41
|
<script>
|
26
42
|
window.BookshopBrowser = new window.BookshopBrowserClass({
|
27
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.16
|
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-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|