cloudcannon-jekyll-bookshop 2.0.0.pre.beta.4 → 2.0.0.pre.beta.8
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/Gemfile.lock +1 -1
- data/lib/cloudcannon-jekyll-bookshop.rb +3 -0
- data/lib/cloudcannon-jekyll-bookshop/tags/live-tag.rb +36 -0
- data/lib/cloudcannon-jekyll-bookshop/version.rb +1 -1
- data/node_modules/@bookshop/cloudcannon-structures/package.json +4 -3
- data/node_modules/@bookshop/toml-narrator/package.json +4 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 405a936492a0503e2907056e44956a29bab6109b2ca9caf489e3cd4a3e258064
|
4
|
+
data.tar.gz: 785283376cf4d38db646b32222786ae9c75d9ed6aeb3154b2bf8e05de64025b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61e2c35ac872bbb98b8624449559dcee4bcffbf9c4f803218cc3987f9e60628573bae639c3e1e8e1f668b02cb9cb489d85a3fe782ec886d3cfe430eec14416a2
|
7
|
+
data.tar.gz: 42b031e622623aaf8e66d60cdb074dff2f85367b24a14ba77bca2c737f17a7e3c5ddf34d07768d51c5d43c0f50bde2af3e5fe95c0e54f8eda756617b2e9abb3e
|
data/Gemfile.lock
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
require "jekyll"
|
4
4
|
require_relative "./cloudcannon-jekyll-bookshop/output-site-data"
|
5
5
|
require_relative "./cloudcannon-jekyll-bookshop/structures"
|
6
|
+
require_relative "./cloudcannon-jekyll-bookshop/tags/live-tag"
|
7
|
+
|
8
|
+
Liquid::Template.register_tag("bookshop_live", CloudCannonJekyllBookshop::LiveTag)
|
6
9
|
|
7
10
|
Jekyll::Hooks.register :site, :after_init do |site|
|
8
11
|
CloudCannonJekyllBookshop::Structures.build_structures(site)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CloudCannonJekyllBookshop
|
4
|
+
class LiveTag < Liquid::Tag
|
5
|
+
def initialize(tag_name, markup, tokens)
|
6
|
+
super
|
7
|
+
@script = markup.strip
|
8
|
+
end
|
9
|
+
|
10
|
+
def render(context)
|
11
|
+
site = context.registers[:site]
|
12
|
+
|
13
|
+
"<script>
|
14
|
+
window.addEventListener('load', function() {
|
15
|
+
if (window.inEditorMode) {
|
16
|
+
const head = document.querySelector('head');
|
17
|
+
const script = document.createElement('script');
|
18
|
+
script.src = `/#{@script}`;
|
19
|
+
script.onload = function() {
|
20
|
+
window.bookshopLive = new window.BookshopLive({
|
21
|
+
remoteGlobals: ['/_cloudcannon/bookshop-site-data.json']
|
22
|
+
});
|
23
|
+
window.CloudCannon = {
|
24
|
+
trigger: function (eventName, frontMatter) {
|
25
|
+
if (typeof frontMatter === 'string') frontMatter = JSON.parse(frontMatter);
|
26
|
+
window.bookshopLive.update({page: frontMatter});
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
head.appendChild(script);
|
31
|
+
}
|
32
|
+
});
|
33
|
+
</script>"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@bookshop/cloudcannon-structures",
|
3
|
-
"version": "2.0.0-beta.
|
3
|
+
"version": "2.0.0-beta.8",
|
4
4
|
"description": "Convert a Bookshop object into a CloudCannon structure",
|
5
5
|
"main": "main.js",
|
6
6
|
"scripts": {
|
7
|
-
"test": "ava -v"
|
7
|
+
"test": "nyc ava -v"
|
8
8
|
},
|
9
9
|
"files": [
|
10
10
|
"main.js",
|
@@ -16,9 +16,10 @@
|
|
16
16
|
"access": "public"
|
17
17
|
},
|
18
18
|
"devDependencies": {
|
19
|
-
"@bookshop/toml-narrator": "
|
19
|
+
"@bookshop/toml-narrator": "2.0.0-beta.8",
|
20
20
|
"@ltd/j-toml": "^1.12.2",
|
21
21
|
"ava": "^3.15.0",
|
22
|
+
"nyc": "^15.1.0",
|
22
23
|
"pluralize": "^8.0.0"
|
23
24
|
},
|
24
25
|
"stableVersion": "2.0.0-beta.3"
|
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@bookshop/toml-narrator",
|
3
|
-
"version": "2.0.0-beta.
|
3
|
+
"version": "2.0.0-beta.8",
|
4
4
|
"description": "Rewrite Bookshop TOML files to preserve comments",
|
5
5
|
"main": "main.js",
|
6
6
|
"scripts": {
|
7
|
-
"test": "ava -v"
|
7
|
+
"test": "nyc ava -v"
|
8
8
|
},
|
9
9
|
"files": [
|
10
10
|
"main.js"
|
@@ -15,7 +15,8 @@
|
|
15
15
|
"access": "public"
|
16
16
|
},
|
17
17
|
"devDependencies": {
|
18
|
-
"ava": "^3.15.0"
|
18
|
+
"ava": "^3.15.0",
|
19
|
+
"nyc": "^15.1.0"
|
19
20
|
},
|
20
21
|
"stableVersion": "2.0.0-beta.3"
|
21
22
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudcannon-jekyll-bookshop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.pre.beta.
|
4
|
+
version: 2.0.0.pre.beta.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liam Bigelow
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- lib/cloudcannon-jekyll-bookshop/output-site-data.rb
|
154
154
|
- lib/cloudcannon-jekyll-bookshop/page-without-a-file.rb
|
155
155
|
- lib/cloudcannon-jekyll-bookshop/structures.rb
|
156
|
+
- lib/cloudcannon-jekyll-bookshop/tags/live-tag.rb
|
156
157
|
- lib/cloudcannon-jekyll-bookshop/version.rb
|
157
158
|
- node_modules/@bookshop/cloudcannon-structures/main.js
|
158
159
|
- node_modules/@bookshop/cloudcannon-structures/package.json
|