jekyll-bookshop 2.0.0.pre.beta.13 → 2.0.0.pre.beta.14
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
- data/lib/jekyll-bookshop/tags/browser-tag.rb +18 -1
- data/lib/jekyll-bookshop/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c67c7fc80faba9aa09db2799914be94703dd183a80f38633d3f3e5126daadfe5
|
4
|
+
data.tar.gz: 163f483d2af7eb8cbdee6750f4ffd6576c348a1a398b4f5c4f3f65a325874f91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8ea960efe36612012f4036e12daaf566c1de8b7766844eefde82311e9ed579f82097dbacbb2e8d02ccd0372053e157beede3d534e6f52a747e4cf46a947a3bf
|
7
|
+
data.tar.gz: ad29a0f8990597b718ef019c59fe38ca5cde97167d6007902f4552659735139d080c835d986893dc18b2bde8901f0b04e7f558f526be764b9277db57342dd9ef
|
@@ -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]
|