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 +4 -12
- package/package.json +1 -1
- package/test/input/permalinks.vto +7 -0
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
|
-
|
|
78
|
-
};
|
|
79
|
-
},
|
|
74
|
+
const result = await env.runString(inputContent, data, inputPath);
|
|
80
75
|
|
|
81
|
-
|
|
82
|
-
|
|
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