eleventy-plugin-vento 2.5.0 → 3.0.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +223 -0
  2. package/LICENSE +1 -1
  3. package/package.json +61 -56
  4. package/readme.md +98 -76
  5. package/src/engine.js +85 -0
  6. package/src/index.js +130 -0
  7. package/src/modules/create-vento-tag.js +56 -0
  8. package/src/modules/ignore-tag.js +15 -0
  9. package/src/modules/utils.js +22 -0
  10. package/.editorconfig +0 -16
  11. package/.github/actions/setup/action.yml +0 -25
  12. package/.github/renovate.json +0 -13
  13. package/.github/workflows/ci.yml +0 -15
  14. package/.github/workflows/release.yml +0 -33
  15. package/.node-version +0 -1
  16. package/.vscode/settings.json +0 -4
  17. package/.vscode/tests.code-snippets +0 -16
  18. package/VentoPlugin.js +0 -130
  19. package/eslint.config.js +0 -67
  20. package/jsconfig.json +0 -11
  21. package/lib/ssr.js +0 -23
  22. package/release.config.js +0 -31
  23. package/tests/autotrim/__snapshots__/autotrim-all.html +0 -53
  24. package/tests/autotrim/__snapshots__/autotrim-single.html +0 -75
  25. package/tests/autotrim/autotrim.test.js +0 -17
  26. package/tests/autotrim/build/autotrim-all.html +0 -53
  27. package/tests/autotrim/build/autotrim-single.html +0 -75
  28. package/tests/autotrim/index.vto +0 -23
  29. package/tests/basic/__snapshots__/template-basic.html +0 -4
  30. package/tests/basic/basic.test.js +0 -9
  31. package/tests/basic/index.vto +0 -7
  32. package/tests/filters/__snapshots__/filters-arguments.html +0 -1
  33. package/tests/filters/__snapshots__/filters-basic.html +0 -2
  34. package/tests/filters/basic.vto +0 -5
  35. package/tests/filters/filters.test.js +0 -33
  36. package/tests/filters/with-arguments.vto +0 -1
  37. package/tests/filters/with-this.vto +0 -1
  38. package/tests/get-instance.js +0 -35
  39. package/tests/includes/__snapshots__/includes-basic.html +0 -8
  40. package/tests/includes/__snapshots__/includes-data.html +0 -8
  41. package/tests/includes/_includes/partial.vto +0 -4
  42. package/tests/includes/basic.vto +0 -7
  43. package/tests/includes/includes.test.js +0 -14
  44. package/tests/includes/with-data.vto +0 -7
  45. package/tests/layouts/__snapshots__/example-layout-1.html +0 -27
  46. package/tests/layouts/__snapshots__/example-layout-2.html +0 -24
  47. package/tests/layouts/_includes/layout1.vto +0 -20
  48. package/tests/layouts/_includes/layout2.vto +0 -17
  49. package/tests/layouts/layouts.test.js +0 -14
  50. package/tests/layouts/page1.vto +0 -11
  51. package/tests/layouts/page2.vto +0 -11
  52. package/tests/permalinks/__snapshots__/permalink-nested.html +0 -15
  53. package/tests/permalinks/__snapshots__/permalink-root.html +0 -15
  54. package/tests/permalinks/_includes/layout.vto +0 -13
  55. package/tests/permalinks/at-nested.vto +0 -7
  56. package/tests/permalinks/at-root.vto +0 -7
  57. package/tests/permalinks/dynamic/dynamic-permalink.vto +0 -6
  58. package/tests/permalinks/dynamic/dynamic.11tydata.json +0 -3
  59. package/tests/permalinks/dynamic-js/dynamic-js.11tydata.js +0 -5
  60. package/tests/permalinks/dynamic-js/dynamic-permalink-js.vto +0 -6
  61. package/tests/permalinks/permalinks.test.js +0 -25
  62. package/tests/permalinks/skip.vto +0 -7
  63. package/tests/shortcodes/__snapshots__/shortcode-with-arguments.html +0 -2
  64. package/tests/shortcodes/basic.vto +0 -1
  65. package/tests/shortcodes/shortcodes.test.js +0 -19
  66. package/tests/shortcodes/with-arguments.vto +0 -2
  67. package/tests/ssr/__snapshots__/ssr-data.html +0 -1
  68. package/tests/ssr/__snapshots__/ssr-echo.html +0 -7
  69. package/tests/ssr/__snapshots__/ssr-exec.html +0 -1
  70. package/tests/ssr/__snapshots__/ssr-for.html +0 -3
  71. package/tests/ssr/__snapshots__/ssr-if.html +0 -5
  72. package/tests/ssr/data.vto +0 -1
  73. package/tests/ssr/echo.vto +0 -7
  74. package/tests/ssr/exec.vto +0 -1
  75. package/tests/ssr/for.vto +0 -3
  76. package/tests/ssr/if.vto +0 -5
  77. package/tests/ssr/ssr.test.js +0 -29
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head><title>{{ title }}</title></head>
4
- <body>
5
- <header>
6
- <h1>Page title: {{ title }}</h1>
7
- </header>
8
- <main>{{ content }}</main>
9
- <footer>
10
- <p>Page footer</p>
11
- </footer>
12
- </body>
13
- </html>
@@ -1,7 +0,0 @@
1
- ---
2
- permalink: /page/at/nested/permalink/
3
- title: Nested Page
4
- layout: layout.vto
5
- ---
6
-
7
- This content lives at `/page/at/nested/permalink/`
@@ -1,7 +0,0 @@
1
- ---
2
- permalink: /
3
- title: Root page
4
- layout: layout.vto
5
- ---
6
-
7
- This should render on the homepage.
@@ -1,6 +0,0 @@
1
- ---
2
- title: Directory data test page
3
- layout: layout.vto
4
- ---
5
-
6
- This page has directory data set with dynamic permalinks
@@ -1,3 +0,0 @@
1
- {
2
- "permalink": "/{{ title |> slugify }}.html"
3
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- permalink({ title }) {
3
- return `${this.slugify(title)}.html`;
4
- },
5
- };
@@ -1,6 +0,0 @@
1
- ---
2
- title: Directory data test page (js)
3
- layout: layout.vto
4
- ---
5
-
6
- This page has directory data set with dynamic permalinks
@@ -1,25 +0,0 @@
1
- import { expect, test } from 'vitest';
2
- import { runBuild } from '#test-instance';
3
-
4
- const results = await runBuild(import.meta.dirname);
5
-
6
- test('render a page at a nested permalink', async () => {
7
- const page = results.find(({ url }) => url === '/page/at/nested/permalink/');
8
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/permalink-nested.html');
9
- });
10
-
11
- test('render a page at root url', async () => {
12
- const page = results.find(({ url }) => url === '/');
13
- expect(page.content).toMatchFileSnapshot('./__snapshots__/permalink-root.html');
14
- });
15
-
16
- test('render a page at a dynamic permalink', async () => {
17
- const page = results.find(({ url }) => url === '/directory-data-test-page.html');
18
-
19
- expect(page).toBeDefined();
20
- });
21
-
22
- test('skips rendering a file', () => {
23
- const writtenTemplates = results.filter(({ url }) => Boolean(url));
24
- expect(writtenTemplates.length).toBe(4);
25
- });
@@ -1,7 +0,0 @@
1
- ---
2
- title: Skipped
3
- layout: layout.vto
4
- permalink: false
5
- ---
6
-
7
- Leave me out of this.
@@ -1,2 +0,0 @@
1
- Release the possums!!!
2
- Release 5 MILLION possums!!!
@@ -1 +0,0 @@
1
- {{ helloWorld() }}
@@ -1,19 +0,0 @@
1
- import { expect, test } from 'vitest';
2
- import { runBuild } from '#test-instance';
3
-
4
- const results = await runBuild(import.meta.dirname, {
5
- eleventy(configApi) {
6
- configApi.addShortcode('helloWorld', () => 'Hello world!');
7
- configApi.addShortcode('possumPosse', (number = 'the') => `Release ${number} possums!!!`);
8
- },
9
- });
10
-
11
- test('shortcode without argument', () => {
12
- const page = results.find(({ url }) => url === '/basic/');
13
- expect(page.content).toBe('Hello world!\n');
14
- });
15
-
16
- test('shortcode with arguments', async () => {
17
- const page = results.find(({ url }) => url === '/with-arguments/');
18
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/shortcode-with-arguments.html');
19
- });
@@ -1,2 +0,0 @@
1
- {{ possumPosse() }}
2
- {{ possumPosse('5 MILLION') }}
@@ -1 +0,0 @@
1
- <p>{{ dynamicValue }}</p>
@@ -1,7 +0,0 @@
1
- {{ echo }}
2
-
3
- {{ dataValue }}
4
-
5
- <p>Some more {{ dataValue }}</p>
6
-
7
- {{ /echo }}
@@ -1 +0,0 @@
1
- {{> console.log('hello world!') }}
@@ -1,3 +0,0 @@
1
- {{ for value of [1,2,3] }}
2
- {{ value }}
3
- {{ /for }}
@@ -1,5 +0,0 @@
1
- {{ if true }}
2
-
3
- <p>Some content</p>
4
-
5
- {{ /if }}
@@ -1 +0,0 @@
1
- <p>{{! dynamicValue }}</p>
@@ -1,7 +0,0 @@
1
- {{! echo }}
2
-
3
- {{! dataValue }}
4
-
5
- <p>Some more {{! dataValue }}</p>
6
-
7
- {{! /echo }}
@@ -1 +0,0 @@
1
- {{!> console.log('hello world!') }}
package/tests/ssr/for.vto DELETED
@@ -1,3 +0,0 @@
1
- {{! for value of [1,2,3] }}
2
- {{! value }}
3
- {{! /for }}
package/tests/ssr/if.vto DELETED
@@ -1,5 +0,0 @@
1
- {{! if true }}
2
-
3
- <p>Some content</p>
4
-
5
- {{! /if }}
@@ -1,29 +0,0 @@
1
- import { expect, test } from 'vitest';
2
- import { runBuild } from '#test-instance';
3
-
4
- const results = await runBuild(import.meta.dirname);
5
-
6
- test('render if', async () => {
7
- const page = results.find(({ url }) => url === '/if/');
8
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/ssr-if.html');
9
- });
10
-
11
- test('render data', async () => {
12
- const page = results.find(({ url }) => url === '/data/');
13
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/ssr-data.html');
14
- });
15
-
16
- test('render for', async () => {
17
- const page = results.find(({ url }) => url === '/for/');
18
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/ssr-for.html');
19
- });
20
-
21
- test('render echo', async () => {
22
- const page = results.find(({ url }) => url === '/echo/');
23
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/ssr-echo.html');
24
- });
25
-
26
- test('render exec', async () => {
27
- const page = results.find(({ url }) => url === '/exec/');
28
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/ssr-exec.html');
29
- });