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.
- package/CHANGELOG.md +223 -0
- package/LICENSE +1 -1
- package/package.json +61 -56
- package/readme.md +98 -76
- package/src/engine.js +85 -0
- package/src/index.js +130 -0
- package/src/modules/create-vento-tag.js +56 -0
- package/src/modules/ignore-tag.js +15 -0
- package/src/modules/utils.js +22 -0
- package/.editorconfig +0 -16
- package/.github/actions/setup/action.yml +0 -25
- package/.github/renovate.json +0 -13
- package/.github/workflows/ci.yml +0 -15
- package/.github/workflows/release.yml +0 -33
- package/.node-version +0 -1
- package/.vscode/settings.json +0 -4
- package/.vscode/tests.code-snippets +0 -16
- package/VentoPlugin.js +0 -130
- package/eslint.config.js +0 -67
- package/jsconfig.json +0 -11
- package/lib/ssr.js +0 -23
- package/release.config.js +0 -31
- package/tests/autotrim/__snapshots__/autotrim-all.html +0 -53
- package/tests/autotrim/__snapshots__/autotrim-single.html +0 -75
- package/tests/autotrim/autotrim.test.js +0 -17
- package/tests/autotrim/build/autotrim-all.html +0 -53
- package/tests/autotrim/build/autotrim-single.html +0 -75
- package/tests/autotrim/index.vto +0 -23
- package/tests/basic/__snapshots__/template-basic.html +0 -4
- package/tests/basic/basic.test.js +0 -9
- package/tests/basic/index.vto +0 -7
- package/tests/filters/__snapshots__/filters-arguments.html +0 -1
- package/tests/filters/__snapshots__/filters-basic.html +0 -2
- package/tests/filters/basic.vto +0 -5
- package/tests/filters/filters.test.js +0 -33
- package/tests/filters/with-arguments.vto +0 -1
- package/tests/filters/with-this.vto +0 -1
- package/tests/get-instance.js +0 -35
- package/tests/includes/__snapshots__/includes-basic.html +0 -8
- package/tests/includes/__snapshots__/includes-data.html +0 -8
- package/tests/includes/_includes/partial.vto +0 -4
- package/tests/includes/basic.vto +0 -7
- package/tests/includes/includes.test.js +0 -14
- package/tests/includes/with-data.vto +0 -7
- package/tests/layouts/__snapshots__/example-layout-1.html +0 -27
- package/tests/layouts/__snapshots__/example-layout-2.html +0 -24
- package/tests/layouts/_includes/layout1.vto +0 -20
- package/tests/layouts/_includes/layout2.vto +0 -17
- package/tests/layouts/layouts.test.js +0 -14
- package/tests/layouts/page1.vto +0 -11
- package/tests/layouts/page2.vto +0 -11
- package/tests/permalinks/__snapshots__/permalink-nested.html +0 -15
- package/tests/permalinks/__snapshots__/permalink-root.html +0 -15
- package/tests/permalinks/_includes/layout.vto +0 -13
- package/tests/permalinks/at-nested.vto +0 -7
- package/tests/permalinks/at-root.vto +0 -7
- package/tests/permalinks/dynamic/dynamic-permalink.vto +0 -6
- package/tests/permalinks/dynamic/dynamic.11tydata.json +0 -3
- package/tests/permalinks/dynamic-js/dynamic-js.11tydata.js +0 -5
- package/tests/permalinks/dynamic-js/dynamic-permalink-js.vto +0 -6
- package/tests/permalinks/permalinks.test.js +0 -25
- package/tests/permalinks/skip.vto +0 -7
- package/tests/shortcodes/__snapshots__/shortcode-with-arguments.html +0 -2
- package/tests/shortcodes/basic.vto +0 -1
- package/tests/shortcodes/shortcodes.test.js +0 -19
- package/tests/shortcodes/with-arguments.vto +0 -2
- package/tests/ssr/__snapshots__/ssr-data.html +0 -1
- package/tests/ssr/__snapshots__/ssr-echo.html +0 -7
- package/tests/ssr/__snapshots__/ssr-exec.html +0 -1
- package/tests/ssr/__snapshots__/ssr-for.html +0 -3
- package/tests/ssr/__snapshots__/ssr-if.html +0 -5
- package/tests/ssr/data.vto +0 -1
- package/tests/ssr/echo.vto +0 -7
- package/tests/ssr/exec.vto +0 -1
- package/tests/ssr/for.vto +0 -3
- package/tests/ssr/if.vto +0 -5
- package/tests/ssr/ssr.test.js +0 -29
|
@@ -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 +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 +0,0 @@
|
|
|
1
|
-
<p>{{ dynamicValue }}</p>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{{> console.log('hello world!') }}
|
package/tests/ssr/data.vto
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<p>{{! dynamicValue }}</p>
|
package/tests/ssr/echo.vto
DELETED
package/tests/ssr/exec.vto
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{{!> console.log('hello world!') }}
|
package/tests/ssr/for.vto
DELETED
package/tests/ssr/if.vto
DELETED
package/tests/ssr/ssr.test.js
DELETED
|
@@ -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
|
-
});
|