coralite-plugin-aggregation 0.6.0 → 0.7.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.
- package/README.md +76 -261
- package/lib/index.js +249 -326
- package/lib/templates/coralite-pagination.html +94 -73
- package/package.json +9 -18
- package/types/index.js +16 -49
- package/dist/blog/all/index.html +0 -75
- package/dist/blog/all/page/2.html +0 -75
- package/dist/blog/all/page/3.html +0 -75
- package/dist/blog/all/page/4.html +0 -75
- package/dist/blog/all/page/5.html +0 -75
- package/dist/blog/index.html +0 -75
- package/dist/blog/page/2.html +0 -75
- package/dist/blog/page/3.html +0 -75
- package/dist/blog/page/4.html +0 -75
- package/dist/blog/page/5.html +0 -75
- package/dist/blog/post-1.html +0 -71
- package/dist/blog/post-2.html +0 -71
- package/dist/blog/post-3.html +0 -71
- package/dist/blog/post-4.html +0 -71
- package/dist/blog/post-5.html +0 -71
- package/dist/index.html +0 -81
- package/dist/page/2.html +0 -81
- package/dist/page/3.html +0 -81
- package/dist/page/4.html +0 -81
- package/dist/products/product-1.html +0 -75
- package/dist/products/product-2.html +0 -72
- package/dist/products/product-3.html +0 -72
- package/dist/products/product-4.html +0 -72
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Document</title>
|
|
7
|
-
<meta name="title" content="New Caledonia Barrier Reef">
|
|
8
|
-
<meta name="author" content="Nemo">
|
|
9
|
-
<meta name="image" content="image.png">
|
|
10
|
-
<meta name="image_alt" content="Photo of a dog">
|
|
11
|
-
<meta name="description" content="The New Caledonia Barrier Reef—second longest double barrier reef, covering 1,500 kilometers">
|
|
12
|
-
<meta name="published_time" content="2025-01-09T20:23:07.645Z">
|
|
13
|
-
<meta name="price" content="2000">
|
|
14
|
-
<meta name="country" content="fr" data-dev="true">
|
|
15
|
-
</head>
|
|
16
|
-
<body>
|
|
17
|
-
|
|
18
|
-
<header>
|
|
19
|
-
This is the mighty header
|
|
20
|
-
<span data-dev="true">Dev mode enabled</span>
|
|
21
|
-
|
|
22
|
-
<h1>New Caledonia Barrier Reef</h1>
|
|
23
|
-
|
|
24
|
-
</header>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<span>Nemo</span>
|
|
28
|
-
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-1">
|
|
29
|
-
Wed, 8 Jan 25
|
|
30
|
-
</time>
|
|
31
|
-
|
|
32
|
-
<script type="module">(async () => {
|
|
33
|
-
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
34
|
-
const elements = {};
|
|
35
|
-
return function(id) {
|
|
36
|
-
if (elements[id]) {
|
|
37
|
-
return elements[id];
|
|
38
|
-
}
|
|
39
|
-
const refId = refs[id];
|
|
40
|
-
if (!refId) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
44
|
-
if (element) {
|
|
45
|
-
elements[id] = element;
|
|
46
|
-
}
|
|
47
|
-
return element;
|
|
48
|
-
};
|
|
49
|
-
} };
|
|
50
|
-
const getHelpers = (context) => {
|
|
51
|
-
const helpers = {};
|
|
52
|
-
for (const key in coraliteTemplateScriptHelpers) {
|
|
53
|
-
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
54
|
-
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
55
|
-
}
|
|
56
|
-
return helpers;
|
|
57
|
-
};
|
|
58
|
-
const coraliteTemplateFunctions = {
|
|
59
|
-
"coralite-author": function script({ values }, { refs }) {
|
|
60
|
-
const timeElement = refs("time");
|
|
61
|
-
timeElement.setAttribute("data-was-here", values.datetime);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
;
|
|
65
|
-
(async () => {
|
|
66
|
-
const context = { "instanceId": "tests/fixtures/pages/products/product-3.html1coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-1" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
67
|
-
const helpers = getHelpers(context);
|
|
68
|
-
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
69
|
-
})();
|
|
70
|
-
})();
|
|
71
|
-
</script></body>
|
|
72
|
-
</html>
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Document</title>
|
|
7
|
-
<meta name="title" content="Bahamas Barrier Reef">
|
|
8
|
-
<meta name="author" content="Nemo">
|
|
9
|
-
<meta name="image" content="image.png">
|
|
10
|
-
<meta name="image_alt" content="Photo of a dog">
|
|
11
|
-
<meta name="description" content="The Andros, Bahamas Barrier Reef—third largest, following the east coast of Andros Island, Bahamas, between Andros and Nassau">
|
|
12
|
-
<meta name="price" content="2000">
|
|
13
|
-
<meta name="published_time" content="2025-01-09T20:23:07.645Z">
|
|
14
|
-
<meta name="country" content="fr" data-dev="true">
|
|
15
|
-
</head>
|
|
16
|
-
<body>
|
|
17
|
-
|
|
18
|
-
<header>
|
|
19
|
-
This is the mighty header
|
|
20
|
-
<span data-dev="true">Dev mode enabled</span>
|
|
21
|
-
|
|
22
|
-
<h1>Bahamas Barrier Reef</h1>
|
|
23
|
-
|
|
24
|
-
</header>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<span>Nemo</span>
|
|
28
|
-
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-1">
|
|
29
|
-
Wed, 8 Jan 25
|
|
30
|
-
</time>
|
|
31
|
-
|
|
32
|
-
<script type="module">(async () => {
|
|
33
|
-
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
34
|
-
const elements = {};
|
|
35
|
-
return function(id) {
|
|
36
|
-
if (elements[id]) {
|
|
37
|
-
return elements[id];
|
|
38
|
-
}
|
|
39
|
-
const refId = refs[id];
|
|
40
|
-
if (!refId) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
44
|
-
if (element) {
|
|
45
|
-
elements[id] = element;
|
|
46
|
-
}
|
|
47
|
-
return element;
|
|
48
|
-
};
|
|
49
|
-
} };
|
|
50
|
-
const getHelpers = (context) => {
|
|
51
|
-
const helpers = {};
|
|
52
|
-
for (const key in coraliteTemplateScriptHelpers) {
|
|
53
|
-
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
54
|
-
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
55
|
-
}
|
|
56
|
-
return helpers;
|
|
57
|
-
};
|
|
58
|
-
const coraliteTemplateFunctions = {
|
|
59
|
-
"coralite-author": function script({ values }, { refs }) {
|
|
60
|
-
const timeElement = refs("time");
|
|
61
|
-
timeElement.setAttribute("data-was-here", values.datetime);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
;
|
|
65
|
-
(async () => {
|
|
66
|
-
const context = { "instanceId": "tests/fixtures/pages/products/product-4.html1coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-1" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
67
|
-
const helpers = getHelpers(context);
|
|
68
|
-
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
69
|
-
})();
|
|
70
|
-
})();
|
|
71
|
-
</script></body>
|
|
72
|
-
</html>
|