eleventy-plugin-vento 1.1.2 → 1.1.3

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/VentoPlugin.js CHANGED
@@ -49,16 +49,13 @@ export function VentoPlugin(eleventyConfig, options = {}) {
49
49
  // Load user-defined plugins into vento
50
50
  for (const plugin of options.plugins) env.use(plugin);
51
51
 
52
- eleventyConfig.on('eleventy.before', () => {
53
- env.cache.clear();
54
- });
55
-
56
52
  // Add vto as a template format and create a custom template for it
57
53
  eleventyConfig.addTemplateFormats('vto');
58
54
  eleventyConfig.addExtension('vto', {
59
55
  outputFileExtension: 'html',
60
56
 
61
57
  async compile(inputContent, inputPath) {
58
+ env.cache.clear();
62
59
  return async (data) => {
63
60
  if (options.addHelpers) {
64
61
  // Extract a possible namespace from the addHelpers option
@@ -74,15 +71,10 @@ export function VentoPlugin(eleventyConfig, options = {}) {
74
71
  else data = { ...data, ...helpers };
75
72
  }
76
73
 
77
- return await env.runString(inputContent, data, inputPath).then((result) => result.content);
78
- };
79
- },
74
+ const result = await env.runString(inputContent, data, inputPath);
80
75
 
81
- compileOptions: {
82
- permalink(contents, inputPath) {
83
- if (!contents) return contents;
84
- return (data) => env.runString(contents, data, inputPath).then((result) => result.content);
85
- },
76
+ return result.content;
77
+ };
86
78
  },
87
79
  });
88
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-vento",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Adds support for the Vento templating language to Eleventy.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@9.1.4",
@@ -0,0 +1,7 @@
1
+ ---
2
+ permalink: /test/page/permalink/
3
+ title: Test page
4
+ layout: page-layout.vto
5
+ ---
6
+
7
+ This content lives at `/test/page/permalink/`