cloudcannon-jekyll-bookshop 2.0.7 → 2.0.10.pre.editorlinks.1
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/tags/live-tag.rb +15 -8
- data/lib/cloudcannon-jekyll-bookshop/version.rb +1 -1
- data/node_modules/@bookshop/cloudcannon-structures/package.json +2 -2
- data/node_modules/@bookshop/toml-narrator/main.js +1 -4
- data/node_modules/@bookshop/toml-narrator/package.json +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f4f92045cee68da506a9afd6be6954f0c545f2873756fe2136689feaef05bd7
|
4
|
+
data.tar.gz: 23324943a32077003f68010936ae926a1273995800060f74cf495c3b638b2da5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64e211702c7f333d3bf633cb0be17c66f9231cf83ef0b2d6a70dd11d704b3b12257b120e712613f8586887522f48839f2ef0e0d80d011e0e7a1df00c19199c32
|
7
|
+
data.tar.gz: 07baa0c39ce7315fc9fbac3f76359db971adea5d0a19c75d975637021bab29aff5034fde2ea3c80303f814cbe23a6dabfa6fbbcc120f954e93d5c99dd9a44d03
|
data/Gemfile.lock
CHANGED
@@ -11,8 +11,10 @@ module CloudCannonJekyllBookshop
|
|
11
11
|
site = context.registers[:site]
|
12
12
|
|
13
13
|
"<script>
|
14
|
-
|
15
|
-
|
14
|
+
(function(){
|
15
|
+
const bookshopLiveSetup = (CloudCannon) => {
|
16
|
+
CloudCannon.enableEvents();
|
17
|
+
|
16
18
|
const head = document.querySelector('head');
|
17
19
|
const script = document.createElement('script');
|
18
20
|
script.src = `/#{@script}`;
|
@@ -20,16 +22,21 @@ window.addEventListener('load', function() {
|
|
20
22
|
window.bookshopLive = new window.BookshopLive({
|
21
23
|
remoteGlobals: ['/_cloudcannon/bookshop-site-data.json']
|
22
24
|
});
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
}
|
25
|
+
const updateBookshopLive = async () => {
|
26
|
+
const frontMatter = await CloudCannon.value();
|
27
|
+
const options = window.bookshopLiveOptions || {};
|
28
|
+
window.bookshopLive.update({page: frontMatter}, options);
|
28
29
|
}
|
30
|
+
document.addEventListener('cloudcannon:update', updateBookshopLive);
|
31
|
+
updateBookshopLive();
|
29
32
|
}
|
30
33
|
head.appendChild(script);
|
31
34
|
}
|
32
|
-
|
35
|
+
|
36
|
+
document.addEventListener('cloudcannon:load', function (e) {
|
37
|
+
bookshopLiveSetup(e.detail.CloudCannon);
|
38
|
+
});
|
39
|
+
})();
|
33
40
|
</script>"
|
34
41
|
end
|
35
42
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@bookshop/cloudcannon-structures",
|
3
3
|
"packageManager": "yarn@3.0.0",
|
4
|
-
"version": "2.0.
|
4
|
+
"version": "2.0.10-editorlinks.1",
|
5
5
|
"description": "Convert a Bookshop object into a CloudCannon structure",
|
6
6
|
"main": "main.js",
|
7
7
|
"scripts": {
|
@@ -17,7 +17,7 @@
|
|
17
17
|
"access": "public"
|
18
18
|
},
|
19
19
|
"devDependencies": {
|
20
|
-
"@bookshop/toml-narrator": "2.0.
|
20
|
+
"@bookshop/toml-narrator": "2.0.10-editorlinks.1",
|
21
21
|
"@ltd/j-toml": "^1.17.0",
|
22
22
|
"ava": "^3.15.0",
|
23
23
|
"nyc": "^15.1.0",
|
@@ -7,7 +7,6 @@ module.exports = {
|
|
7
7
|
const isVariableComment = /^[a-z0-9\-_\.\s]+=.*?#.+?$/i;
|
8
8
|
// [some_section] #: Some comment
|
9
9
|
const isBlockComment = /^\s*?\[.*?#.+?$/i;
|
10
|
-
|
11
10
|
const extractComment = /#:([^#]+)$/i;
|
12
11
|
const extractVariable = /^\s*?([a-z0-9\-_\.]+)\s?=/i;
|
13
12
|
|
@@ -15,12 +14,10 @@ module.exports = {
|
|
15
14
|
const [, comment] = extractComment.exec(line) || [];
|
16
15
|
const [, variable_name] = extractVariable.exec(line) || [];
|
17
16
|
if (!comment || !variable_name) return line;
|
18
|
-
|
19
|
-
return `${variable_name}--bookshop_comment = "${comment.trim()}"\n${line}`
|
17
|
+
return `${variable_name}--bookshop_comment = "${comment.replace(/"/g, '\"').trim()}"\n${line}`
|
20
18
|
} else if (isBlockComment.test(line)) {
|
21
19
|
const [, comment] = extractComment.exec(line) || [];
|
22
20
|
if (!comment) return line;
|
23
|
-
|
24
21
|
return `${line}\n--bookshop_comment = "${comment.trim()}"`
|
25
22
|
} else {
|
26
23
|
return line;
|
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.
|
4
|
+
version: 2.0.10.pre.editorlinks.1
|
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-10-
|
11
|
+
date: 2021-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -175,9 +175,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
175
175
|
version: 2.3.0
|
176
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- - "
|
178
|
+
- - ">"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
180
|
+
version: 1.3.1
|
181
181
|
requirements: []
|
182
182
|
rubygems_version: 3.0.3
|
183
183
|
signing_key:
|