I have a Nunjucks shortcode in an Eleventy project. It's added to configuration in eleventy.js
with the Eleventy addNunjucksAsyncShortcode
method. My shortcode has gotten extremely messy with complex HTML string literals, and I'd like to refactor it into using a Nunjucks template along with the logic in my shortcode Javascript file.
Is there any way I can include and render a Nunjucks template in my async shortcode, or to call a Nunjucks template with the async shortcode config (which I could then use to include methods from my Javascript logic file)? It seems like the Nunjucks object is a singleton, and I get errors trying to use it.