coralite-plugin-aggregation 0.5.4 → 0.6.0

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.
@@ -16,21 +16,60 @@
16
16
 
17
17
 
18
18
 
19
- <a href>
19
+ <a href="/blog/post-1.html">
20
20
  <h3>Great Barrier Reef</h3>
21
21
  </a>
22
22
 
23
23
 
24
24
  <span>Nemo</span>
25
- <time datetime="2025-01-08T20:23:07.645Z">
25
+ <time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
26
26
  Wed, 8 Jan 25
27
27
  </time>
28
28
 
29
- The Great Barrier Reef&#x2014;largest, comprising over 2,900 individual reefs and 900 islands stretching for over 2,600 kilometers
29
+
30
30
 
31
- <ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">Next</a></li></ul>
31
+ <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="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">Next</a></li></ul>
32
32
 
33
33
 
34
34
  </section>
35
- </body>
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/blog/all/index.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "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>
36
75
  </html>
@@ -16,21 +16,60 @@
16
16
 
17
17
 
18
18
 
19
- <a href>
19
+ <a href="/blog/post-1.html">
20
20
  <h3>Great Barrier Reef</h3>
21
21
  </a>
22
22
 
23
23
 
24
24
  <span>Nemo</span>
25
- <time datetime="2025-01-08T20:23:07.645Z">
25
+ <time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
26
26
  Wed, 8 Jan 25
27
27
  </time>
28
28
 
29
- The Great Barrier Reef&#x2014;largest, comprising over 2,900 individual reefs and 900 islands stretching for over 2,600 kilometers
29
+
30
30
 
31
- <ul class="pagination"><li class="page-item"><a class="page-link" href="/blog/all/index.html">Previous</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">Next</a></li></ul>
31
+ <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="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">Next</a></li></ul>
32
32
 
33
33
 
34
34
  </section>
35
- </body>
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/blog/all/page/2.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "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>
36
75
  </html>
@@ -16,21 +16,60 @@
16
16
 
17
17
 
18
18
 
19
- <a href>
20
- <h3>Mesoamerican Barrier Reef System</h3>
19
+ <a href="/blog/post-1.html">
20
+ <h3>Great Barrier Reef</h3>
21
21
  </a>
22
22
 
23
23
 
24
24
  <span>Nemo</span>
25
- <time datetime="2025-01-09T20:23:07.645Z">
26
- Thu, 9 Jan 25
25
+ <time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
26
+ Wed, 8 Jan 25
27
27
  </time>
28
28
 
29
- The Mesoamerican Barrier Reef System&#x2014;second largest, stretching 1,000 kilometers
29
+
30
30
 
31
- <ul class="pagination"><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">Previous</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/all/page/3.html">3</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/4.html">4</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/4.html">Next</a></li></ul>
31
+ <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="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">Next</a></li></ul>
32
32
 
33
33
 
34
34
  </section>
35
- </body>
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/blog/all/page/3.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "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>
36
75
  </html>
@@ -16,21 +16,60 @@
16
16
 
17
17
 
18
18
 
19
- <a href>
20
- <h3>New Caledonia Barrier Reef</h3>
19
+ <a href="/blog/post-1.html">
20
+ <h3>Great Barrier Reef</h3>
21
21
  </a>
22
22
 
23
23
 
24
24
  <span>Nemo</span>
25
- <time datetime="2025-01-09T20:23:07.645Z">
26
- Thu, 9 Jan 25
25
+ <time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
26
+ Wed, 8 Jan 25
27
27
  </time>
28
28
 
29
- The New Caledonia Barrier Reef&#x2014;second longest double barrier reef, covering 1,500 kilometers
29
+
30
30
 
31
- <ul class="pagination"><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">Previous</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/all/index.html">1</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/all/page/4.html">4</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">Next</a></li></ul>
31
+ <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="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">Next</a></li></ul>
32
32
 
33
33
 
34
34
  </section>
35
- </body>
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/blog/all/page/4.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "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>
36
75
  </html>
@@ -16,21 +16,60 @@
16
16
 
17
17
 
18
18
 
19
- <a href>
20
- <h3>Bahamas Barrier Reef</h3>
19
+ <a href="/blog/post-1.html">
20
+ <h3>Great Barrier Reef</h3>
21
21
  </a>
22
22
 
23
23
 
24
24
  <span>Nemo</span>
25
- <time datetime="2025-01-09T20:23:07.645Z">
26
- Thu, 9 Jan 25
25
+ <time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
26
+ Wed, 8 Jan 25
27
27
  </time>
28
28
 
29
- The Andros, Bahamas Barrier Reef&#x2014;third largest, following the east coast of Andros Island, Bahamas, between Andros and Nassau
29
+
30
30
 
31
- <ul class="pagination"><li class="page-item"><a class="page-link" href="/blog/all/page/4.html">Previous</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/all/index.html">1</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/4.html">4</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/all/page/5.html">5</a></li><li class="page-item disabled"><span class="page-link">Next</span></li></ul>
31
+ <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="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">Next</a></li></ul>
32
32
 
33
33
 
34
34
  </section>
35
- </body>
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/blog/all/page/5.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "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>
36
75
  </html>
@@ -16,21 +16,60 @@
16
16
 
17
17
 
18
18
 
19
- <a href>
19
+ <a href="/blog/post-1.html">
20
20
  <h3>Great Barrier Reef</h3>
21
21
  </a>
22
22
 
23
23
 
24
24
  <span>Nemo</span>
25
- <time datetime="2025-01-08T20:23:07.645Z">
25
+ <time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
26
26
  Wed, 8 Jan 25
27
27
  </time>
28
28
 
29
- The Great Barrier Reef&#x2014;largest, comprising over 2,900 individual reefs and 900 islands stretching for over 2,600 kilometers
29
+
30
30
 
31
- <ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">Next</a></li></ul>
31
+ <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="/blog/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">Next</a></li></ul>
32
32
 
33
33
 
34
34
  </section>
35
- </body>
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/blog/index.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "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>
36
75
  </html>
@@ -16,21 +16,60 @@
16
16
 
17
17
 
18
18
 
19
- <a href>
19
+ <a href="/blog/post-1.html">
20
20
  <h3>Great Barrier Reef</h3>
21
21
  </a>
22
22
 
23
23
 
24
24
  <span>Nemo</span>
25
- <time datetime="2025-01-08T20:23:07.645Z">
25
+ <time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
26
26
  Wed, 8 Jan 25
27
27
  </time>
28
28
 
29
- The Great Barrier Reef&#x2014;largest, comprising over 2,900 individual reefs and 900 islands stretching for over 2,600 kilometers
29
+
30
30
 
31
- <ul class="pagination"><li class="page-item"><a class="page-link" href="/blog/index.html">Previous</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/index.html">1</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/page/3.html">Next</a></li></ul>
31
+ <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="/blog/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">Next</a></li></ul>
32
32
 
33
33
 
34
34
  </section>
35
- </body>
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/blog/page/2.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "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>
36
75
  </html>
@@ -16,21 +16,60 @@
16
16
 
17
17
 
18
18
 
19
- <a href>
20
- <h3>Mesoamerican Barrier Reef System</h3>
19
+ <a href="/blog/post-1.html">
20
+ <h3>Great Barrier Reef</h3>
21
21
  </a>
22
22
 
23
23
 
24
24
  <span>Nemo</span>
25
- <time datetime="2025-01-09T20:23:07.645Z">
26
- Thu, 9 Jan 25
25
+ <time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
26
+ Wed, 8 Jan 25
27
27
  </time>
28
28
 
29
- The Mesoamerican Barrier Reef System&#x2014;second largest, stretching 1,000 kilometers
29
+
30
30
 
31
- <ul class="pagination"><li class="page-item"><a class="page-link" href="/blog/page/2.html">Previous</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">2</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/page/3.html">3</a></li><li class="page-item"><a class="page-link" href="/blog/page/4.html">4</a></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/page/4.html">Next</a></li></ul>
31
+ <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="/blog/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">Next</a></li></ul>
32
32
 
33
33
 
34
34
  </section>
35
- </body>
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/blog/page/3.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "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>
36
75
  </html>
@@ -16,21 +16,60 @@
16
16
 
17
17
 
18
18
 
19
- <a href>
20
- <h3>New Caledonia Barrier Reef</h3>
19
+ <a href="/blog/post-1.html">
20
+ <h3>Great Barrier Reef</h3>
21
21
  </a>
22
22
 
23
23
 
24
24
  <span>Nemo</span>
25
- <time datetime="2025-01-09T20:23:07.645Z">
26
- Thu, 9 Jan 25
25
+ <time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
26
+ Wed, 8 Jan 25
27
27
  </time>
28
28
 
29
- The New Caledonia Barrier Reef&#x2014;second longest double barrier reef, covering 1,500 kilometers
29
+
30
30
 
31
- <ul class="pagination"><li class="page-item"><a class="page-link" href="/blog/page/3.html">Previous</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/index.html">1</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/page/3.html">3</a></li><li class="page-item"><a class="page-link active" aria-current="page" href="/blog/page/4.html">4</a></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">Next</a></li></ul>
31
+ <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="/blog/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">Next</a></li></ul>
32
32
 
33
33
 
34
34
  </section>
35
- </body>
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/blog/page/4.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "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>
36
75
  </html>