eleventy-plugin-vento 2.6.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 -140
- 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/computed-data/__snapshots__/from-local-key.html +0 -4
- package/tests/computed-data/computed-data.test.js +0 -9
- package/tests/computed-data/from-local-key.vto +0 -9
- package/tests/engine-overrides/__snapshots__/as-html-engine.html +0 -4
- package/tests/engine-overrides/__snapshots__/as-md-engine.html +0 -2
- package/tests/engine-overrides/as-html-engine.html +0 -7
- package/tests/engine-overrides/as-md-engine.md +0 -7
- package/tests/engine-overrides/eleventy.config.js +0 -4
- package/tests/engine-overrides/engine-overrides.test.js +0 -14
- 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/eleventy.config.js +0 -13
- package/tests/filters/filters.test.js +0 -19
- package/tests/filters/with-arguments.vto +0 -1
- package/tests/filters/with-this.vto +0 -1
- package/tests/get-instance.js +0 -38
- 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/eleventy.config.js +0 -4
- package/tests/shortcodes/shortcodes.test.js +0 -14
- 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,17 +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>{{ title }}</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<header>
|
|
10
|
-
<h1>Page title: {{ title }}</h1>
|
|
11
|
-
</header>
|
|
12
|
-
<main>{{ content }}</main>
|
|
13
|
-
<footer>
|
|
14
|
-
<p>I am a footer, outside the layout</p>
|
|
15
|
-
</footer>
|
|
16
|
-
</body>
|
|
17
|
-
</html>
|
|
@@ -1,14 +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 page with example layout 1', async () => {
|
|
7
|
-
const page = results.find(({ url }) => url === '/page1/');
|
|
8
|
-
await expect(page.content).toMatchFileSnapshot('./__snapshots__/example-layout-1.html');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
test('render page with example layout 2', async () => {
|
|
12
|
-
const page = results.find(({ url }) => url === '/page2/');
|
|
13
|
-
await expect(page.content).toMatchFileSnapshot('./__snapshots__/example-layout-2.html');
|
|
14
|
-
});
|
package/tests/layouts/page1.vto
DELETED
package/tests/layouts/page2.vto
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head><title>Nested Page</title></head>
|
|
4
|
-
<body>
|
|
5
|
-
<header>
|
|
6
|
-
<h1>Page title: Nested Page</h1>
|
|
7
|
-
</header>
|
|
8
|
-
<main>
|
|
9
|
-
This content lives at `/page/at/nested/permalink/`
|
|
10
|
-
</main>
|
|
11
|
-
<footer>
|
|
12
|
-
<p>Page footer</p>
|
|
13
|
-
</footer>
|
|
14
|
-
</body>
|
|
15
|
-
</html>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head><title>Root page</title></head>
|
|
4
|
-
<body>
|
|
5
|
-
<header>
|
|
6
|
-
<h1>Page title: Root page</h1>
|
|
7
|
-
</header>
|
|
8
|
-
<main>
|
|
9
|
-
This should render on the homepage.
|
|
10
|
-
</main>
|
|
11
|
-
<footer>
|
|
12
|
-
<p>Page footer</p>
|
|
13
|
-
</footer>
|
|
14
|
-
</body>
|
|
15
|
-
</html>
|
|
@@ -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,14 +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('shortcode without argument', () => {
|
|
7
|
-
const page = results.find(({ url }) => url === '/basic/');
|
|
8
|
-
expect(page.content).toBe('Hello world!\n');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
test('shortcode with arguments', async () => {
|
|
12
|
-
const page = results.find(({ url }) => url === '/with-arguments/');
|
|
13
|
-
await expect(page.content).toMatchFileSnapshot('./__snapshots__/shortcode-with-arguments.html');
|
|
14
|
-
});
|
|
@@ -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
|
-
});
|