chocolateboy/parcel-plugin-nunjucks

Feature: generate multiple outputs from one template file

kalitine opened this issue · 1 comments

In my case, I want to generate multiple outputs from one template file by specifying different nunjucks configurations. Each configuration file represents the same content but in different languages. Is it possible to achieve with the current v1.1.0 or not?

I think the best way to do this would be with a build step, possibly using nunjucks to generate the variants via one of its wrappers, e.g.:

Note that if you want the generated variants to (also) be nunjucks templates i.e. using nunjucks templates to generate nunjucks templates, the delimiters in the source template(s) can be customized to distinguish them from the delimiters in the target templates. Or you can use the {% raw %} (AKA {% verbatim %}) tags as suggested here.