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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c27acbf119b2591a6bf5338666e2e6d4e31c019d45e462a38fb8479b6138f45
4
- data.tar.gz: ed5d3f499e7466724f504f545eef5ed513a28c2e378b512f0e860490f699ab39
3
+ metadata.gz: ae3691f75c45319beafded876f14bdbe63f232a9eae5c0cbc0e1a35ca3786939
4
+ data.tar.gz: 20b6ce171d8b1acef0dd87140e2055e35cc5cf561896973f48ec880b13a9e48b
5
5
  SHA512:
6
- metadata.gz: a9c6c4c80fa1c79efe7cbea55a1b05698ed527d3a13ba4ea534df5600044e80cf589ff49e4f69810e982c14e138f47a94fdc67f832171e2f86c11d6210287f1a
7
- data.tar.gz: c8aae3e4cd0739e5737976df7c18df5f13d953268ca0926cc50b49f664a4959104f798bc1eecf496ba516215a09e23dfb5b6c4c2f5bfbcf5676548fd47574f0e
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
- return if Jekyll.env == "production"
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=\"//#{@host}\"></script>
40
+ <script src=\"#{host}\"></script>
25
41
  <script>
26
42
  window.BookshopBrowser = new window.BookshopBrowserClass({
27
43
  globals: [window.bookshop_browser_site_data]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllBookshop
4
- VERSION = "2.0.0.pre.beta.12"
4
+ VERSION = "2.0.0.pre.beta.16"
5
5
  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.beta.12
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-04 00:00:00.000000000 Z
11
+ date: 2021-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll