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
package/dist/blog/post-4.html
DELETED
|
@@ -1,71 +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="published_time" content="2025-01-09T20:23:07.645Z">
|
|
13
|
-
<meta name="country" content="fr" data-dev="true">
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
|
|
17
|
-
<header>
|
|
18
|
-
This is the mighty header
|
|
19
|
-
<span data-dev="true">Dev mode enabled</span>
|
|
20
|
-
|
|
21
|
-
<h1>Bahamas Barrier Reef</h1>
|
|
22
|
-
|
|
23
|
-
</header>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<span>Nemo</span>
|
|
27
|
-
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-1">
|
|
28
|
-
Wed, 8 Jan 25
|
|
29
|
-
</time>
|
|
30
|
-
|
|
31
|
-
<script type="module">(async () => {
|
|
32
|
-
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
33
|
-
const elements = {};
|
|
34
|
-
return function(id) {
|
|
35
|
-
if (elements[id]) {
|
|
36
|
-
return elements[id];
|
|
37
|
-
}
|
|
38
|
-
const refId = refs[id];
|
|
39
|
-
if (!refId) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
43
|
-
if (element) {
|
|
44
|
-
elements[id] = element;
|
|
45
|
-
}
|
|
46
|
-
return element;
|
|
47
|
-
};
|
|
48
|
-
} };
|
|
49
|
-
const getHelpers = (context) => {
|
|
50
|
-
const helpers = {};
|
|
51
|
-
for (const key in coraliteTemplateScriptHelpers) {
|
|
52
|
-
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
53
|
-
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
54
|
-
}
|
|
55
|
-
return helpers;
|
|
56
|
-
};
|
|
57
|
-
const coraliteTemplateFunctions = {
|
|
58
|
-
"coralite-author": function script({ values }, { refs }) {
|
|
59
|
-
const timeElement = refs("time");
|
|
60
|
-
timeElement.setAttribute("data-was-here", values.datetime);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
;
|
|
64
|
-
(async () => {
|
|
65
|
-
const context = { "instanceId": "tests/fixtures/pages/blog/post-4.html1coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-1" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
66
|
-
const helpers = getHelpers(context);
|
|
67
|
-
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
68
|
-
})();
|
|
69
|
-
})();
|
|
70
|
-
</script></body>
|
|
71
|
-
</html>
|
package/dist/blog/post-5.html
DELETED
|
@@ -1,71 +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="Red Sea">
|
|
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 Red Sea includes 6,000-year-old fringing reefs located along a 2,000 km (1,240 mi) coastline">
|
|
12
|
-
<meta name="published_time" content="2025-01-09T20:23:07.645Z">
|
|
13
|
-
<meta name="country" content="fr" data-dev="true">
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
|
|
17
|
-
<header>
|
|
18
|
-
This is the mighty header
|
|
19
|
-
<span data-dev="true">Dev mode enabled</span>
|
|
20
|
-
|
|
21
|
-
<h1>Red Sea</h1>
|
|
22
|
-
|
|
23
|
-
</header>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<span>Nemo</span>
|
|
27
|
-
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-1">
|
|
28
|
-
Wed, 8 Jan 25
|
|
29
|
-
</time>
|
|
30
|
-
|
|
31
|
-
<script type="module">(async () => {
|
|
32
|
-
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
33
|
-
const elements = {};
|
|
34
|
-
return function(id) {
|
|
35
|
-
if (elements[id]) {
|
|
36
|
-
return elements[id];
|
|
37
|
-
}
|
|
38
|
-
const refId = refs[id];
|
|
39
|
-
if (!refId) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
43
|
-
if (element) {
|
|
44
|
-
elements[id] = element;
|
|
45
|
-
}
|
|
46
|
-
return element;
|
|
47
|
-
};
|
|
48
|
-
} };
|
|
49
|
-
const getHelpers = (context) => {
|
|
50
|
-
const helpers = {};
|
|
51
|
-
for (const key in coraliteTemplateScriptHelpers) {
|
|
52
|
-
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
53
|
-
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
54
|
-
}
|
|
55
|
-
return helpers;
|
|
56
|
-
};
|
|
57
|
-
const coraliteTemplateFunctions = {
|
|
58
|
-
"coralite-author": function script({ values }, { refs }) {
|
|
59
|
-
const timeElement = refs("time");
|
|
60
|
-
timeElement.setAttribute("data-was-here", values.datetime);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
;
|
|
64
|
-
(async () => {
|
|
65
|
-
const context = { "instanceId": "tests/fixtures/pages/blog/post-5.html1coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-1" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
66
|
-
const helpers = getHelpers(context);
|
|
67
|
-
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
68
|
-
})();
|
|
69
|
-
})();
|
|
70
|
-
</script></body>
|
|
71
|
-
</html>
|
package/dist/index.html
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>Blog posts</title>
|
|
8
|
-
<meta name="name" content="coralite">
|
|
9
|
-
<meta name="description" content="look mum, no database!">
|
|
10
|
-
</head>
|
|
11
|
-
|
|
12
|
-
<body>
|
|
13
|
-
|
|
14
|
-
<h1>Build database free websites</h1>
|
|
15
|
-
<hr>
|
|
16
|
-
|
|
17
|
-
<section id="pagination">
|
|
18
|
-
<h2>Paginated blog posts</h2>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<a href="/products/product-1.html">
|
|
23
|
-
<h3>Great Barrier Reef</h3>
|
|
24
|
-
</a>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<span>Nemo</span>
|
|
28
|
-
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
29
|
-
Wed, 8 Jan 25
|
|
30
|
-
</time>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/index.html">1</a></li><li class="page-item"><a class="page-link" href="/page/2.html">2</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/page/4.html">4</a></li><li class="page-item"><a class="page-link" href="/page/2.html">Next</a></li></ul>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</section>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<script type="module">(async () => {
|
|
41
|
-
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
42
|
-
const elements = {};
|
|
43
|
-
return function(id) {
|
|
44
|
-
if (elements[id]) {
|
|
45
|
-
return elements[id];
|
|
46
|
-
}
|
|
47
|
-
const refId = refs[id];
|
|
48
|
-
if (!refId) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
52
|
-
if (element) {
|
|
53
|
-
elements[id] = element;
|
|
54
|
-
}
|
|
55
|
-
return element;
|
|
56
|
-
};
|
|
57
|
-
} };
|
|
58
|
-
const getHelpers = (context) => {
|
|
59
|
-
const helpers = {};
|
|
60
|
-
for (const key in coraliteTemplateScriptHelpers) {
|
|
61
|
-
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
62
|
-
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
63
|
-
}
|
|
64
|
-
return helpers;
|
|
65
|
-
};
|
|
66
|
-
const coraliteTemplateFunctions = {
|
|
67
|
-
"coralite-author": function script({ values }, { refs }) {
|
|
68
|
-
const timeElement = refs("time");
|
|
69
|
-
timeElement.setAttribute("data-was-here", values.datetime);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
;
|
|
73
|
-
(async () => {
|
|
74
|
-
const context = { "instanceId": "tests/fixtures/pages/index.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
75
|
-
const helpers = getHelpers(context);
|
|
76
|
-
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
77
|
-
})();
|
|
78
|
-
})();
|
|
79
|
-
</script></body>
|
|
80
|
-
|
|
81
|
-
</html>
|
package/dist/page/2.html
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>Blog posts</title>
|
|
8
|
-
<meta name="name" content="coralite">
|
|
9
|
-
<meta name="description" content="look mum, no database!">
|
|
10
|
-
</head>
|
|
11
|
-
|
|
12
|
-
<body>
|
|
13
|
-
|
|
14
|
-
<h1>Build database free websites</h1>
|
|
15
|
-
<hr>
|
|
16
|
-
|
|
17
|
-
<section id="pagination">
|
|
18
|
-
<h2>Paginated blog posts</h2>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<a href="/products/product-1.html">
|
|
23
|
-
<h3>Great Barrier Reef</h3>
|
|
24
|
-
</a>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<span>Nemo</span>
|
|
28
|
-
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
29
|
-
Wed, 8 Jan 25
|
|
30
|
-
</time>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/index.html">1</a></li><li class="page-item"><a class="page-link" href="/page/2.html">2</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/page/4.html">4</a></li><li class="page-item"><a class="page-link" href="/page/2.html">Next</a></li></ul>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</section>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<script type="module">(async () => {
|
|
41
|
-
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
42
|
-
const elements = {};
|
|
43
|
-
return function(id) {
|
|
44
|
-
if (elements[id]) {
|
|
45
|
-
return elements[id];
|
|
46
|
-
}
|
|
47
|
-
const refId = refs[id];
|
|
48
|
-
if (!refId) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
52
|
-
if (element) {
|
|
53
|
-
elements[id] = element;
|
|
54
|
-
}
|
|
55
|
-
return element;
|
|
56
|
-
};
|
|
57
|
-
} };
|
|
58
|
-
const getHelpers = (context) => {
|
|
59
|
-
const helpers = {};
|
|
60
|
-
for (const key in coraliteTemplateScriptHelpers) {
|
|
61
|
-
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
62
|
-
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
63
|
-
}
|
|
64
|
-
return helpers;
|
|
65
|
-
};
|
|
66
|
-
const coraliteTemplateFunctions = {
|
|
67
|
-
"coralite-author": function script({ values }, { refs }) {
|
|
68
|
-
const timeElement = refs("time");
|
|
69
|
-
timeElement.setAttribute("data-was-here", values.datetime);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
;
|
|
73
|
-
(async () => {
|
|
74
|
-
const context = { "instanceId": "tests/fixtures/pages/page/2.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
75
|
-
const helpers = getHelpers(context);
|
|
76
|
-
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
77
|
-
})();
|
|
78
|
-
})();
|
|
79
|
-
</script></body>
|
|
80
|
-
|
|
81
|
-
</html>
|
package/dist/page/3.html
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>Blog posts</title>
|
|
8
|
-
<meta name="name" content="coralite">
|
|
9
|
-
<meta name="description" content="look mum, no database!">
|
|
10
|
-
</head>
|
|
11
|
-
|
|
12
|
-
<body>
|
|
13
|
-
|
|
14
|
-
<h1>Build database free websites</h1>
|
|
15
|
-
<hr>
|
|
16
|
-
|
|
17
|
-
<section id="pagination">
|
|
18
|
-
<h2>Paginated blog posts</h2>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<a href="/products/product-1.html">
|
|
23
|
-
<h3>Great Barrier Reef</h3>
|
|
24
|
-
</a>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<span>Nemo</span>
|
|
28
|
-
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
29
|
-
Wed, 8 Jan 25
|
|
30
|
-
</time>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/index.html">1</a></li><li class="page-item"><a class="page-link" href="/page/2.html">2</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/page/4.html">4</a></li><li class="page-item"><a class="page-link" href="/page/2.html">Next</a></li></ul>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</section>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<script type="module">(async () => {
|
|
41
|
-
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
42
|
-
const elements = {};
|
|
43
|
-
return function(id) {
|
|
44
|
-
if (elements[id]) {
|
|
45
|
-
return elements[id];
|
|
46
|
-
}
|
|
47
|
-
const refId = refs[id];
|
|
48
|
-
if (!refId) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
52
|
-
if (element) {
|
|
53
|
-
elements[id] = element;
|
|
54
|
-
}
|
|
55
|
-
return element;
|
|
56
|
-
};
|
|
57
|
-
} };
|
|
58
|
-
const getHelpers = (context) => {
|
|
59
|
-
const helpers = {};
|
|
60
|
-
for (const key in coraliteTemplateScriptHelpers) {
|
|
61
|
-
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
62
|
-
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
63
|
-
}
|
|
64
|
-
return helpers;
|
|
65
|
-
};
|
|
66
|
-
const coraliteTemplateFunctions = {
|
|
67
|
-
"coralite-author": function script({ values }, { refs }) {
|
|
68
|
-
const timeElement = refs("time");
|
|
69
|
-
timeElement.setAttribute("data-was-here", values.datetime);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
;
|
|
73
|
-
(async () => {
|
|
74
|
-
const context = { "instanceId": "tests/fixtures/pages/page/3.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
75
|
-
const helpers = getHelpers(context);
|
|
76
|
-
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
77
|
-
})();
|
|
78
|
-
})();
|
|
79
|
-
</script></body>
|
|
80
|
-
|
|
81
|
-
</html>
|
package/dist/page/4.html
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>Blog posts</title>
|
|
8
|
-
<meta name="name" content="coralite">
|
|
9
|
-
<meta name="description" content="look mum, no database!">
|
|
10
|
-
</head>
|
|
11
|
-
|
|
12
|
-
<body>
|
|
13
|
-
|
|
14
|
-
<h1>Build database free websites</h1>
|
|
15
|
-
<hr>
|
|
16
|
-
|
|
17
|
-
<section id="pagination">
|
|
18
|
-
<h2>Paginated blog posts</h2>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<a href="/products/product-1.html">
|
|
23
|
-
<h3>Great Barrier Reef</h3>
|
|
24
|
-
</a>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<span>Nemo</span>
|
|
28
|
-
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
29
|
-
Wed, 8 Jan 25
|
|
30
|
-
</time>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/index.html">1</a></li><li class="page-item"><a class="page-link" href="/page/2.html">2</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/page/4.html">4</a></li><li class="page-item"><a class="page-link" href="/page/2.html">Next</a></li></ul>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</section>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<script type="module">(async () => {
|
|
41
|
-
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
42
|
-
const elements = {};
|
|
43
|
-
return function(id) {
|
|
44
|
-
if (elements[id]) {
|
|
45
|
-
return elements[id];
|
|
46
|
-
}
|
|
47
|
-
const refId = refs[id];
|
|
48
|
-
if (!refId) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
52
|
-
if (element) {
|
|
53
|
-
elements[id] = element;
|
|
54
|
-
}
|
|
55
|
-
return element;
|
|
56
|
-
};
|
|
57
|
-
} };
|
|
58
|
-
const getHelpers = (context) => {
|
|
59
|
-
const helpers = {};
|
|
60
|
-
for (const key in coraliteTemplateScriptHelpers) {
|
|
61
|
-
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
62
|
-
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
63
|
-
}
|
|
64
|
-
return helpers;
|
|
65
|
-
};
|
|
66
|
-
const coraliteTemplateFunctions = {
|
|
67
|
-
"coralite-author": function script({ values }, { refs }) {
|
|
68
|
-
const timeElement = refs("time");
|
|
69
|
-
timeElement.setAttribute("data-was-here", values.datetime);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
;
|
|
73
|
-
(async () => {
|
|
74
|
-
const context = { "instanceId": "tests/fixtures/pages/page/4.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
75
|
-
const helpers = getHelpers(context);
|
|
76
|
-
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
77
|
-
})();
|
|
78
|
-
})();
|
|
79
|
-
</script></body>
|
|
80
|
-
|
|
81
|
-
</html>
|
|
@@ -1,75 +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="Great Barrier Reef">
|
|
8
|
-
<meta name="author" content="Nemo">
|
|
9
|
-
<meta name="image" content="image.png">
|
|
10
|
-
<meta name="image_alt" content="Photo of a cat">
|
|
11
|
-
<meta name="description" content="The Great Barrier Reef—largest, comprising over 2,900 individual reefs and 900 islands stretching for over 2,600 kilometers">
|
|
12
|
-
<meta name="price" content="1000">
|
|
13
|
-
<meta name="published_time" content="2025-01-08T20:23:07.645Z">
|
|
14
|
-
<meta name="country" content="au" data-dev="true">
|
|
15
|
-
|
|
16
|
-
<meta name="test" content="test">
|
|
17
|
-
|
|
18
|
-
</head>
|
|
19
|
-
<body>
|
|
20
|
-
|
|
21
|
-
<header>
|
|
22
|
-
This is the mighty header
|
|
23
|
-
<span data-dev="true">Dev mode enabled</span>
|
|
24
|
-
|
|
25
|
-
<h1>Great Barrier Reef</h1>
|
|
26
|
-
|
|
27
|
-
</header>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<span>Nemo</span>
|
|
31
|
-
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-2">
|
|
32
|
-
Wed, 8 Jan 25
|
|
33
|
-
</time>
|
|
34
|
-
|
|
35
|
-
<script type="module">(async () => {
|
|
36
|
-
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
37
|
-
const elements = {};
|
|
38
|
-
return function(id) {
|
|
39
|
-
if (elements[id]) {
|
|
40
|
-
return elements[id];
|
|
41
|
-
}
|
|
42
|
-
const refId = refs[id];
|
|
43
|
-
if (!refId) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
47
|
-
if (element) {
|
|
48
|
-
elements[id] = element;
|
|
49
|
-
}
|
|
50
|
-
return element;
|
|
51
|
-
};
|
|
52
|
-
} };
|
|
53
|
-
const getHelpers = (context) => {
|
|
54
|
-
const helpers = {};
|
|
55
|
-
for (const key in coraliteTemplateScriptHelpers) {
|
|
56
|
-
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
57
|
-
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
58
|
-
}
|
|
59
|
-
return helpers;
|
|
60
|
-
};
|
|
61
|
-
const coraliteTemplateFunctions = {
|
|
62
|
-
"coralite-author": function script({ values }, { refs }) {
|
|
63
|
-
const timeElement = refs("time");
|
|
64
|
-
timeElement.setAttribute("data-was-here", values.datetime);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
;
|
|
68
|
-
(async () => {
|
|
69
|
-
const context = { "instanceId": "tests/fixtures/pages/products/product-1.html2coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-2" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
70
|
-
const helpers = getHelpers(context);
|
|
71
|
-
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
72
|
-
})();
|
|
73
|
-
})();
|
|
74
|
-
</script></body>
|
|
75
|
-
</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="Mesoamerican Barrier Reef System">
|
|
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 Mesoamerican Barrier Reef System—second largest, stretching 1,000 kilometers">
|
|
12
|
-
<meta name="published_time" content="2025-01-09T20:23:07.645Z">
|
|
13
|
-
<meta name="price" content="1500">
|
|
14
|
-
<meta name="country" content="mx" 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>Mesoamerican Barrier Reef System</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-2.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>
|